OSDN Git Service
(root)
/
php-libraries
/
Router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3433e53
)
Use preg_quote on regex as for security reasons
author
Jefersson Nathan
<admin@phpse.net>
Mon, 19 Dec 2016 12:05:19 +0000
(09:05 -0300)
committer
Jefersson Nathan
<admin@phpse.net>
Mon, 19 Dec 2016 12:05:19 +0000
(09:05 -0300)
src/Router.php
patch
|
blob
|
history
diff --git
a/src/Router.php
b/src/Router.php
index
8a4ddf0
..
11d44bf
100755
(executable)
--- a/
src/Router.php
+++ b/
src/Router.php
@@
-113,7
+113,7
@@
class Router
}
$route = rtrim($routes->getRegex(), '/');
- $pattern =
"@^{$this->basePath}{$route}/?$@i"
;
+ $pattern =
'@^' . preg_quote($this->basePath) . preg_quote($route). '/?$@i'
;
if (!preg_match($pattern, $requestUrl, $matches)) {
continue;
}