Browse Source

corrige un bug dans la génération d'url

master
vince vince 1 year ago
parent
commit
1527497072
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      index.php

+ 2
- 0
index.php View File

@ -8,6 +8,8 @@ define('REQUEST_REGEX', '/^https?:\/\/.+\/(?<supplier>' . 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)) {


Loading…
Cancel
Save