From 7ebcdf57c5b20e38ae5c8930b878069c33203b63 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 23:09:10 -0500 Subject: [PATCH] refactor redirect class. --- system/redirect.php | 10 +++++----- system/url.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/redirect.php b/system/redirect.php index 97990baa..b7f37e6f 100644 --- a/system/redirect.php +++ b/system/redirect.php @@ -24,12 +24,12 @@ class Redirect { * Create a redirect response. * * @param string $url - * @param string $method * @param int $status + * @param string $method * @param bool $https * @return Redirect */ - public static function to($url, $method = 'location', $status = 302, $https = false) + public static function to($url, $status = 302, $method = 'location', $https = false) { $url = URL::to($url, $https); @@ -42,13 +42,13 @@ class Redirect { * Create a redirect response to a HTTPS URL. * * @param string $url - * @param string $method * @param int $status + * @param string $method * @return Response */ - public static function to_secure($url, $method = 'location', $status = 302) + public static function to_secure($url, $status = 302, $method = 'location') { - return static::to($url, $method, $status, true); + return static::to($url, $status, $method, true); } /** diff --git a/system/url.php b/system/url.php index 04c239b8..c3fc53a0 100644 --- a/system/url.php +++ b/system/url.php @@ -28,7 +28,7 @@ class URL { $base = 'https://'.substr($base, 7); } - return rtrim($base, '/').'/'.ltrim($url, '/'); + return rtrim($base, '/').'/'.trim($url, '/'); } /**