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)) {