Fixed bug in URL::to method.

This commit is contained in:
Taylor Otwell 2011-07-28 11:09:13 -05:00
parent 3c8da4df93
commit 8871ddff1b
1 changed files with 8 additions and 2 deletions

View File

@ -21,9 +21,15 @@ public static function to($url = '', $https = false, $asset = false)
$base = Config::get('application.url').'/'.Config::get('application.index');
$base = ($asset) ? str_replace('/'.Config::get('application.index'), '', $base) : $base;
if ($asset and Config::get('application.index') !== '')
{
$base = str_replace('/'.Config::get('application.index'), '', $base);
}
$base = ($https and strpos($base, 'http://') === 0) ? 'https://'.substr($base, 7) : $base;
if ($https and strpos($base, 'http://') === 0)
{
$base = 'https://'.substr($base, 7);
}
return rtrim($base, '/').'/'.ltrim($url, '/');
}