diff --git a/index.php b/index.php index 54d21d2..ac1d537 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,8 @@ define('SUPPLIER_REGEX', '/^[A-Za-z]\w{0,31}$/'); define('EVENT_REGEX', '/^\d{4}\-[01]\d\-[0123]\d$/'); define('ACTION_REGEX', '/^[a-z]{1,16}$/i'); -$requestUrl = trim(str_replace($_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']), '?'); +$baseUrl = trim((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '/'); +$requestUrl = trim(str_replace($_SERVER['QUERY_STRING'], '', $baseUrl), '?'); if (preg_match(REQUEST_REGEX, $requestUrl, $match)) { $requestSupplier = array_key_exists('supplier', $match) ? $match['supplier'] : null; @@ -187,6 +188,9 @@ if ($action === 'config') { $isConfig = true; } +$suppliers = array_keys($config); +sort($suppliers); + try { $event = array_key_exists('event', $_REQUEST) ? $_REQUEST['event'] : $requestEvent; $hasEvent = ( @@ -333,12 +337,26 @@ if (!$isConfig and $hasSupplier) {
-
-
+
+
+
+
+ + + +
+ / + + +
+
+