Fix Nickname::isSystemPath() work properly for routes
This commit is contained in:
parent
c8753353ed
commit
338df7e35b
@ -180,18 +180,18 @@ class Nickname
|
||||
// All directory and file names in site root should be blacklisted
|
||||
$d = dir(INSTALLDIR);
|
||||
while (false !== ($entry = $d->read())) {
|
||||
$paths[] = $entry;
|
||||
$paths[$entry] = true;
|
||||
}
|
||||
$d->close();
|
||||
|
||||
// All top level names in the router should be blacklisted
|
||||
$router = Router::get();
|
||||
foreach (array_keys($router->m->getPaths()) as $path) {
|
||||
if (preg_match('/^\/(.*?)[\/\?]/',$path,$matches)) {
|
||||
$paths[] = $matches[1];
|
||||
foreach ($router->m->getPaths() as $path) {
|
||||
if (preg_match('/^([^\/\?]+)[\/\?]/',$path,$matches) && isset($matches[1])) {
|
||||
$paths[$matches[1]] = true;
|
||||
}
|
||||
}
|
||||
return in_array($str, $paths);
|
||||
return in_array($str, array_keys($paths));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ class URLMapper
|
||||
throw new Exception(sprintf("Can't connect %s; path has no action.", $path));
|
||||
}
|
||||
|
||||
$allpaths[] = $path;
|
||||
$this->allpaths[] = $path;
|
||||
|
||||
$action = $args[self::ACTION];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user