Skip to content

Commit

Permalink
Doing some refactoring, to reduce code duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 30, 2010
1 parent 3ca0cdb commit dbce29a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cake/libs/router.php
Expand Up @@ -820,16 +820,15 @@ public static function url($url = null, $full = false) {
}
}
$protocol = strpos($output, '://');
if ($protocol > 3 && $protocol < 6) {
return $output . $extension . self::queryString($q, array(), $escape) . $frag;
}
$output = str_replace('//', '/', $base . '/' . $output);
if ($protocol === false || $protocol > 6) {
$output = str_replace('//', '/', $base . '/' . $output);

if ($full && defined('FULL_BASE_URL')) {
$output = FULL_BASE_URL . $output;
}
if (!empty($extension)) {
$output = rtrim($output, '/');
if ($full && defined('FULL_BASE_URL')) {
$output = FULL_BASE_URL . $output;
}
if (!empty($extension)) {
$output = rtrim($output, '/');
}
}
return $output . $extension . self::queryString($q, array(), $escape) . $frag;
}
Expand Down

0 comments on commit dbce29a

Please sign in to comment.