Skip to content

Commit

Permalink
Using a simple regexp instead of a strpos to ensure the protocol is a…
Browse files Browse the repository at this point in the history
…t the beginning of the url.
  • Loading branch information
markstory committed Oct 30, 2010
1 parent 3a95a54 commit 148870f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/router.php
Expand Up @@ -824,8 +824,8 @@ public static function url($url = null, $full = false) {
$output .= Inflector::underscore($params['controller']) . '/' . $url;
}
}
$protocol = strpos($output, '://');
if ($protocol === false || $protocol > 6) {
$protocol = preg_match('#^[a-z]+\://#', $output);
if ($protocol === 0) {
$output = str_replace('//', '/', $base . '/' . $output);

if ($full && defined('FULL_BASE_URL')) {
Expand Down

0 comments on commit 148870f

Please sign in to comment.