From dbce29a058a9185fe5933dc25f44381fcbdfd858 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 29 Oct 2010 21:37:03 -0400 Subject: [PATCH] Doing some refactoring, to reduce code duplication. --- cake/libs/router.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index b949599b1..167310b18 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -820,16 +820,15 @@ class Router { } } $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; }