Doing some refactoring, to reduce code duplication.

This commit is contained in:
Mark Story 2010-10-29 21:37:03 -04:00
parent 3ca0cdb1ee
commit dbce29a058

View file

@ -820,16 +820,15 @@ class Router {
} }
} }
$protocol = strpos($output, '://'); $protocol = strpos($output, '://');
if ($protocol > 3 && $protocol < 6) { if ($protocol === false || $protocol > 6) {
return $output . $extension . self::queryString($q, array(), $escape) . $frag; $output = str_replace('//', '/', $base . '/' . $output);
}
$output = str_replace('//', '/', $base . '/' . $output);
if ($full && defined('FULL_BASE_URL')) { if ($full && defined('FULL_BASE_URL')) {
$output = FULL_BASE_URL . $output; $output = FULL_BASE_URL . $output;
} }
if (!empty($extension)) { if (!empty($extension)) {
$output = rtrim($output, '/'); $output = rtrim($output, '/');
}
} }
return $output . $extension . self::queryString($q, array(), $escape) . $frag; return $output . $extension . self::queryString($q, array(), $escape) . $frag;
} }