Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAnthon Pang <apang@softwaredevelopment.ca>2014-01-20 22:13:51 +0400
committerAnthon Pang <apang@softwaredevelopment.ca>2014-01-20 22:14:10 +0400
commitf6279778845c39066142491ca2221a4261443924 (patch)
treea47d785a9f57a66d71ffcdacfb4cf9ddd30f84ba /core
parent481030b75df0beaed946805a2430f6de66a19979 (diff)
fixes #4559 - check git file exists before trying to read it
Diffstat (limited to 'core')
-rw-r--r--core/AssetManager/UIAssetCacheBuster.php3
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;