From c7d53039cf59f5ea9828b499f850ec594a7bb95e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 27 Aug 2014 23:22:50 +0100 Subject: [PATCH] Add cacheCode to dynamic resource urls --- CRM/Utils/File.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 82a18ccc0c..a95f4d4203 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -728,10 +728,14 @@ HTACCESS; * @param string $fileName * @return string */ - static function dynamicResourceUrl($fileName) { + static function dynamicResourceUrl($fileName, $addCacheCode = TRUE) { $config = CRM_Core_Config::singleton(); // FIXME: Need a better way of getting the url of the baseFilePath - return self::addTrailingSlash(str_replace('/persist/contribute', '', $config->imageUploadURL), '/') . 'dynamic/' . $fileName; + $url = self::addTrailingSlash(str_replace('/persist/contribute', '', $config->imageUploadURL), '/') . 'dynamic/' . $fileName; + if ($addCacheCode) { + return $url . '?r=' . CRM_Core_Resources::singleton()->getCacheCode(); + } + return $url; } /** -- 2.25.1