Skip to content

Commit

Permalink
Fix subtle error in Regex matching URI scheme.
Browse files Browse the repository at this point in the history
[+-.] will match plus, hyphen, and dot, but also comma. Use [+\-.] since  commas not allowed in URI scheme.
  • Loading branch information
HaroldPutman committed Jun 21, 2013
1 parent 2fd36bd commit 1ff77f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Routing/Router.php
Expand Up @@ -888,7 +888,7 @@ public static function url($url = null, $full = false) {
$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);

Expand Down

0 comments on commit 1ff77f2

Please sign in to comment.