Merge pull request #228 from rootcoma/logins

Hacks to avoid reserved filenames
This commit is contained in:
tannn 2013-12-05 17:12:21 -08:00
commit 8f0394138b
1 changed files with 10 additions and 2 deletions

View File

@ -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);
}
}
}