diff --git a/index.php b/index.php index ca7e580..a72353c 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,10 @@ if (preg_match(REQUEST_REGEX, $requestUrl, $match)) { $requestUrl = rtrim(str_replace($requestEvent, '', $requestUrl), '/'); if (!is_null($requestSupplier)) $requestUrl = rtrim(str_replace($requestSupplier, '', $requestUrl), '/'); -} +} else { + $requestSupplier = null; + $requestEvent = null; +} function generateUrl($supplier = null, $event = null) { global $requestUrl; @@ -81,13 +84,12 @@ $hasSupplier = is_string($supplier) and preg_match('/^' . SUPPLIER_REGEX . '$/', $excludesFormatter = new \IntlDateFormatter('fr_FR.UTF8', \IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, 'Europe/Paris'); +$supplierIsNew = false; if ($hasSupplier) { if (!isset($config[$supplier])) { $config[$supplier] = []; $supplierIsNew = true; - } else { - $supplierIsNew = false; } $config[$supplier] = array_merge( @@ -653,50 +655,57 @@ if ($supplierIsNew and !empty($suppliers)) { -