Hacks to avoid reserved filenames
This commit is contained in:
parent
f891710d79
commit
e58f73142f
|
|
@ -66,8 +66,12 @@ class Router
|
|||
|
||||
// loop trough parameter names, store matching value in $params array
|
||||
foreach ($argument_keys as $key => $name) {
|
||||
if (isset($matches[$key + 1]))
|
||||
if (isset($matches[$key + 1])) {
|
||||
if($matches[$key + 1] == '*' || $matches[$key + 1] == '**') {
|
||||
$matches[$key + 1] = str_replace('*', '.', $matches[$key + 1]);
|
||||
}
|
||||
$params[$name] = $matches[$key + 1];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -98,8 +102,12 @@ class Router
|
|||
|
||||
// loop trough parameter names, store matching value in $params array
|
||||
foreach ($param_keys as $i => $key) {
|
||||
if (isset($params[$key]))
|
||||
if (isset($params[$key])) {
|
||||
if($params[$key] == '.' || $params[$key] == '..') {
|
||||
$params[$key] = str_replace('.', '*', $params[$key]);
|
||||
}
|
||||
$url = preg_replace("/:(\w+)/", $params[$key], $url, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue