Browse Source

params urlencode, #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@136 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
pzinovkin 15 years ago
parent
commit
cb3ac1a04f
  1. 4
      app/router/Route.php

4
app/router/Route.php

@ -39,7 +39,7 @@ class Route
for ($i = 0; $i < $cnt; $i++) { for ($i = 0; $i < $cnt; $i++) {
if (substr($parts[$i], 0, 1) == ':') { if (substr($parts[$i], 0, 1) == ':') {
$this->params[substr($parts[$i], 1)] = $request[$i];
$this->params[substr($parts[$i], 1)] = urldecode($request[$i]);
} elseif (substr($parts[$i], 0, 2) == '(?') { } elseif (substr($parts[$i], 0, 2) == '(?') {
$match = array(); $match = array();
if (!preg_match('#^' . $parts[$i] . '$#iu', $request[$i], $match)) { if (!preg_match('#^' . $parts[$i] . '$#iu', $request[$i], $match)) {
@ -47,7 +47,7 @@ class Route
} }
$start = strpos($parts[$i], '<') + 1; $start = strpos($parts[$i], '<') + 1;
$key = substr($parts[$i], $start, strpos($parts[$i], '>', $start) - $start); $key = substr($parts[$i], $start, strpos($parts[$i], '>', $start) - $start);
$this->params[$key] = $match[$key];
$this->params[$key] = urldecode($match[$key]);
} elseif ($parts[$i] != $request[$i]) { } elseif ($parts[$i] != $request[$i]) {
return false; return false;
} }

Loading…
Cancel
Save