Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit 1ff77f2363eb7403bb994bd78f18c0793a3d00c9 1 parent 2fd36bd
Harold Putman authored June 21, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/Cake/Routing/Router.php
2  lib/Cake/Routing/Router.php
@@ -888,7 +888,7 @@ public static function url($url = null, $full = false) {
888 888
 				$output .= Inflector::underscore($params['controller']) . '/' . $url;
889 889
 			}
890 890
 		}
891  
-		$protocol = preg_match('#^[a-z][a-z0-9+-.]*\://#i', $output);
  891
+		$protocol = preg_match('#^[a-z][a-z0-9+\-.]*\://#i', $output);
892 892
 		if ($protocol === 0) {
893 893
 			$output = str_replace('//', '/', $base . '/' . $output);
894 894
 

0 notes on commit 1ff77f2

Please sign in to comment.
Something went wrong with that request. Please try again.