Skip to content

Commit 1ff77f2

Browse files
committed
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.
1 parent 2fd36bd commit 1ff77f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Cake/Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ public static function url($url = null, $full = false) {
888888
$output .= Inflector::underscore($params['controller']) . '/' . $url;
889889
}
890890
}
891-
$protocol = preg_match('#^[a-z][a-z0-9+-.]*\://#i', $output);
891+
$protocol = preg_match('#^[a-z][a-z0-9+\-.]*\://#i', $output);
892892
if ($protocol === 0) {
893893
$output = str_replace('//', '/', $base . '/' . $output);
894894

0 commit comments

Comments
 (0)