Created
October 26, 2011 16:53
-
-
Save Gillingham/1316978 to your computer and use it in GitHub Desktop.
vanilla use static CDN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- functions.general.php.bak 2011-10-26 09:29:58.500837342 -0700 | |
+++ functions.general.php 2011-10-26 09:51:18.896882681 -0700 | |
@@ -332,9 +332,14 @@ | |
if (substr($Destination, 0, 7) == 'http://' || substr($Destination, 0, 8) == 'https://') { | |
$Result = $Destination; | |
} else { | |
- $Parts = array(Gdn_Url::WebRoot($WithDomain), $Destination); | |
- if (!$WithDomain) | |
- array_unshift($Parts, '/'); | |
+ $cdn = Gdn::Config('Garden.CDN', NULL); | |
+ if(!is_null($cdn)) | |
+ $Parts = array($cdn, $Destination); | |
+ else { | |
+ $Parts = array(Gdn_Url::WebRoot($WithDomain), $Destination); | |
+ if (!$WithDomain) | |
+ array_unshift($Parts, '/'); | |
+ } | |
$Result = CombinePaths($Parts, '/'); | |
} | |
@@ -2095,9 +2100,14 @@ | |
if (substr($Destination, 0, 7) == 'http://' || substr($Destination, 0, 8) == 'https://') { | |
$Result = $Destination; | |
} else { | |
- $Parts = array(Gdn_Url::WebRoot($WithDomain), $Destination); | |
- if (!$WithDomain) | |
- array_unshift($Parts, '/'); | |
+ $cdn = Gdn::Config('Garden.CDN', NULL); | |
+ if(!is_null($cdn)) | |
+ $Parts = array($cdn, $Destination); | |
+ else { | |
+ $Parts = array(Gdn_Url::WebRoot($WithDomain), $Destination); | |
+ if (!$WithDomain) | |
+ array_unshift($Parts, '/'); | |
+ } | |
$Result = CombinePaths($Parts, '/'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment