Using a simple regexp instead of a strpos to ensure the protocol is at the beginning of the url.

This commit is contained in:
Mark Story 2010-10-29 22:10:24 -04:00
parent 3a95a546e8
commit 148870f492

View file

@ -824,8 +824,8 @@ class Router {
$output .= Inflector::underscore($params['controller']) . '/' . $url; $output .= Inflector::underscore($params['controller']) . '/' . $url;
} }
} }
$protocol = strpos($output, '://'); $protocol = preg_match('#^[a-z]+\://#', $output);
if ($protocol === false || $protocol > 6) { if ($protocol === 0) {
$output = str_replace('//', '/', $base . '/' . $output); $output = str_replace('//', '/', $base . '/' . $output);
if ($full && defined('FULL_BASE_URL')) { if ($full && defined('FULL_BASE_URL')) {