diff options
author | Anthon Pang <apang@softwaredevelopment.ca> | 2014-01-20 22:13:51 +0400 |
---|---|---|
committer | Anthon Pang <apang@softwaredevelopment.ca> | 2014-01-20 22:14:10 +0400 |
commit | f6279778845c39066142491ca2221a4261443924 (patch) | |
tree | a47d785a9f57a66d71ffcdacfb4cf9ddd30f84ba /core | |
parent | 481030b75df0beaed946805a2430f6de66a19979 (diff) |
fixes #4559 - check git file exists before trying to read it
Diffstat (limited to 'core')
-rw-r--r-- | core/AssetManager/UIAssetCacheBuster.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/AssetManager/UIAssetCacheBuster.php b/core/AssetManager/UIAssetCacheBuster.php index a8359442b3..181a559c95 100644 --- a/core/AssetManager/UIAssetCacheBuster.php +++ b/core/AssetManager/UIAssetCacheBuster.php @@ -30,7 +30,8 @@ class UIAssetCacheBuster extends Singleton */ public function piwikVersionBasedCacheBuster($pluginNames = false) { - $currentGitHash = @file_get_contents(PIWIK_INCLUDE_PATH . '/.git/refs/heads/master'); + $masterFile = PIWIK_INCLUDE_PATH . '/.git/refs/heads/master'; + $currentGitHash = file_exists($masterFile) ? @file_get_contents($masterFile) : null; $pluginList = md5(implode(",", !$pluginNames ? Manager::getInstance()->getLoadedPluginsName() : $pluginNames)); $cacheBuster = md5(SettingsPiwik::getSalt() . $pluginList . PHP_VERSION . Version::VERSION . trim($currentGitHash)); return $cacheBuster; |