diff index.php @ 62:4cb6f04f95c1 default tip

Fix handling url with %2F path
author nanaya <me@nanaya.net>
date Sat, 08 Feb 2025 01:52:13 +0900
parents 72580314dd6a
children
line wrap: on
line diff
--- a/index.php	Sat Feb 23 02:42:40 2019 +0900
+++ b/index.php	Sat Feb 08 01:52:13 2025 +0900
@@ -10,7 +10,11 @@
     if ($query_string_start !== false) {
         $uri = substr($uri, 0, $query_string_start);
     }
-    $uri = urldecode($uri);
+    $decodedUri = urldecode($uri);
+    if (stripos($uri, '%2F') !== false) {
+        header("Location: {$decodedUri}");
+    }
+    $uri = $decodedUri;
 
     // $dir: filesystem path
     if (isset($_SERVER["DL_DIR"])) {