From 152749707293b89063d9d097044619dbe2e9c01f Mon Sep 17 00:00:00 2001 From: vince Date: Wed, 29 Dec 2021 14:59:34 +0100 Subject: [PATCH] =?UTF-8?q?corrige=20un=20bug=20dans=20la=20g=C3=A9n=C3=A9?= =?UTF-8?q?ration=20d'url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.php b/index.php index a72353c..95215aa 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,8 @@ define('REQUEST_REGEX', '/^https?:\/\/.+\/(?' . SUPPLIER_REGEX . ')\/? define('ACTION_REGEX', '/^[a-z]{1,16}$/i'); $baseUrl = trim((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '/'); +if (($pos = strpos($baseUrl, '?')) !== false) + $baseUrl = substr($baseUrl, 0, $pos); $requestUrl = trim(array_key_exists('QUERY_STRING', $_SERVER) ? str_replace($_SERVER['QUERY_STRING'], '', $baseUrl) : $baseUrl, '?'); if (preg_match(REQUEST_REGEX, $requestUrl, $match)) {