Skip to content
This repository
Browse code

Applying fix from 'euromark' to fix protocol relative links

Fixes #2107
  • Loading branch information...
commit 55064b6573722eb377d633c06545c25d06691871 1 parent 1d8199b
Mark Story authored October 17, 2011
2  lib/Cake/Routing/Router.php
@@ -775,7 +775,7 @@ public static function url($url = null, $full = false) {
775 775
 			}
776 776
 		} else {
777 777
 			if (
778  
-				(strpos($url, '://') ||
  778
+				(strpos($url, '://') !== false ||
779 779
 				(strpos($url, 'javascript:') === 0) ||
780 780
 				(strpos($url, 'mailto:') === 0)) ||
781 781
 				(!strncmp($url, '#', 1))
3  lib/Cake/Test/Case/Routing/RouterTest.php
@@ -2420,6 +2420,9 @@ public function testUrlProtocol() {
2420 2420
 
2421 2421
 		$url = 'svn+ssh://example.com';
2422 2422
 		$this->assertEqual($url, Router::url($url));
  2423
+
  2424
+		$url = '://example.com';
  2425
+		$this->assertEqual($url, Router::url($url));
2423 2426
 	}
2424 2427
 
2425 2428
 /**

0 notes on commit 55064b6

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