Jinhui Zhu 7 роки тому
батько
коміт
556b2c34ae
2 змінених файлів з 8 додано та 1 видалено
  1. 1 1
      Qii/Request/Http.php
  2. 7 0
      Qii/Router/Parse/Normal.php

+ 1 - 1
Qii/Request/Http.php

@@ -55,7 +55,7 @@ final class Http extends Request
                         }
                     } else {
                         if ($pos = strstr($request_uri, '?')) {
-                            $request_uri = substr($request_uri, 0, $pos - 1);
+                            $request_uri = substr($request_uri, 0, strlen($pos) - 1);
                         }
                     }
                     break;

+ 7 - 0
Qii/Router/Parse/Normal.php

@@ -58,6 +58,13 @@ class Normal
         $dirInfo[] = $fileName;
         $dir = [];
         $match = ['key' => '', 'val' => '', 'url' => $url];
+        if($this->config['*:*']) {
+            list($controller, $action) = explode(':', $this->config['*:*']);
+            $match['match'] = '*:*';
+            $match['controller'] = $controller ? $controller : 'index';
+            $match['action'] = $action ? $action : 'index';
+            return $match;
+        }
         foreach ($dirInfo AS $path) {
             $dir[] = $path;
             $joinPath = join($dir, ':') . ":*";