Fix subtle error in Regex matching URI scheme.

[+-.] will match plus, hyphen, and dot, but also comma. Use [+\-.] since  commas not allowed in URI scheme.
This commit is contained in:
Harold Putman 2013-06-21 15:17:59 -04:00
parent 2fd36bdedc
commit 1ff77f2363

View file

@ -888,7 +888,7 @@ class Router {
$output .= Inflector::underscore($params['controller']) . '/' . $url;
}
}
$protocol = preg_match('#^[a-z][a-z0-9+-.]*\://#i', $output);
$protocol = preg_match('#^[a-z][a-z0-9+\-.]*\://#i', $output);
if ($protocol === 0) {
$output = str_replace('//', '/', $base . '/' . $output);