Support albums with question marks in them
[noxon-gateway.git] / src / header.php
index 772f0fdecdff5b40acb8914fd804fed9d9769a16..785ada50b3241f672829de9be5f5fec553f4eeb0 100644 (file)
@@ -1,10 +1,9 @@
 <?php
 set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../src/');
 <?php
 set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../src/');
-$path = $fullUri = urldecode($_SERVER['REQUEST_URI']);//with query string
-$qPos = strpos($fullUri, '?');
-if ($qPos !== false) {
-    $path = substr($fullUri, 0, $qPos);
-}
+
+$requestUriNoQuery = explode('?', $_SERVER['REQUEST_URI'])[0];
+$path = $fullUri = urldecode($requestUriNoQuery);
+
 $dataDir = __DIR__ . '/../data/';
 $varDir  = realpath(__DIR__ . '/../var') . '/';
 $cacheDir = __DIR__ . '/../www/cache/';
 $dataDir = __DIR__ . '/../data/';
 $varDir  = realpath(__DIR__ . '/../var') . '/';
 $cacheDir = __DIR__ . '/../www/cache/';