Commit 338df7e3 authored by mmn's avatar mmn

Fix Nickname::isSystemPath() work properly for routes

parent c8753353
...@@ -180,18 +180,18 @@ class Nickname ...@@ -180,18 +180,18 @@ class Nickname
// All directory and file names in site root should be blacklisted // All directory and file names in site root should be blacklisted
$d = dir(INSTALLDIR); $d = dir(INSTALLDIR);
while (false !== ($entry = $d->read())) { while (false !== ($entry = $d->read())) {
$paths[] = $entry; $paths[$entry] = true;
} }
$d->close(); $d->close();
// All top level names in the router should be blacklisted // All top level names in the router should be blacklisted
$router = Router::get(); $router = Router::get();
foreach (array_keys($router->m->getPaths()) as $path) { foreach ($router->m->getPaths() as $path) {
if (preg_match('/^\/(.*?)[\/\?]/',$path,$matches)) { if (preg_match('/^([^\/\?]+)[\/\?]/',$path,$matches) && isset($matches[1])) {
$paths[] = $matches[1]; $paths[$matches[1]] = true;
} }
} }
return in_array($str, $paths); return in_array($str, array_keys($paths));
} }
/** /**
......
...@@ -66,7 +66,7 @@ class URLMapper ...@@ -66,7 +66,7 @@ class URLMapper
throw new Exception(sprintf("Can't connect %s; path has no action.", $path)); throw new Exception(sprintf("Can't connect %s; path has no action.", $path));
} }
$allpaths[] = $path; $this->allpaths[] = $path;
$action = $args[self::ACTION]; $action = $args[self::ACTION];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment