This commit is contained in:
Colin Viebrock
2012-04-23 23:43:09 -05:00
parent 71d361e071
commit 11b0d243ff
2 changed files with 13 additions and 3 deletions

View File

@@ -220,6 +220,18 @@ class URL {
*/
public static function to_asset($url, $https = null)
{
// If the URL is already well-formed, just return it
if (static::valid($url)) return $url;
// If a base asset URL is defined in the configuration, use that and
// don't try and change links to http/https.
if ($root = Config::get('application.asset_url', false )) {
return rtrim($root, '/').'/'.ltrim($url, '/');
}
if (is_null($https)) $https = Request::secure();
$url = static::to($url, $https);