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
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-05-16 03:01:25 +0400
committermattab <matthieu.aubry@gmail.com>2014-05-16 03:01:25 +0400
commitc3c791498104c56c9bc94ea1754ae17d0decda4c (patch)
tree701bfeb9f4c1e5058373dc2a26af917456519678
parent12c2146a1e2cac328088127702e803f88aaec603 (diff)
parent034d6da03c073d35fe87a6aa7647d6a614d912a7 (diff)
Merge branch 'master' of github.com:piwik/piwik
-rw-r--r--core/AssetManager.php2
-rw-r--r--core/Option.php2
-rw-r--r--core/View.php20
3 files changed, 17 insertions, 7 deletions
diff --git a/core/AssetManager.php b/core/AssetManager.php
index c026be4ba2..90185a43f3 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -373,7 +373,7 @@ class AssetManager extends Singleton
/**
* @return UIAsset
*/
- private function getMergedStylesheetAsset()
+ public function getMergedStylesheetAsset()
{
return $this->getMergedUIAsset(self::MERGED_CSS_FILE);
}
diff --git a/core/Option.php b/core/Option.php
index 5d39866454..7f6ae85cab 100644
--- a/core/Option.php
+++ b/core/Option.php
@@ -163,7 +163,7 @@ class Option
return $this->all[$name];
}
$value = Db::fetchOne('SELECT option_value ' .
- 'FROM `' . Common::prefixTable('option') . '`' .
+ 'FROM `' . Common::prefixTable('option') . '` ' .
'WHERE option_name = ?', $name);
if ($value === false) {
return false;
diff --git a/core/View.php b/core/View.php
index 8b78482201..6f140d4b91 100644
--- a/core/View.php
+++ b/core/View.php
@@ -252,8 +252,18 @@ class View implements ViewInterface
protected function applyFilter_cacheBuster($output)
{
- $cacheBuster = UIAssetCacheBuster::getInstance()->piwikVersionBasedCacheBuster();
- $tag = 'cb=' . $cacheBuster;
+ $assetManager = AssetManager::getInstance();
+
+ $stylesheet = $assetManager->getMergedStylesheetAsset();
+ if ($stylesheet->exists()) {
+ $content = $stylesheet->getContent();
+ } else {
+ $content = $assetManager->getMergedStylesheet()->getContent();
+ }
+
+ $cacheBuster = UIAssetCacheBuster::getInstance();
+ $tagJs = 'cb=' . $cacheBuster->piwikVersionBasedCacheBuster();
+ $tagCss = 'cb=' . $cacheBuster->md5BasedCacheBuster($content);
$pattern = array(
'~<script type=[\'"]text/javascript[\'"] src=[\'"]([^\'"]+)[\'"]>~',
@@ -264,9 +274,9 @@ class View implements ViewInterface
);
$replace = array(
- '<script type="text/javascript" src="$1?' . $tag . '">',
- '<script type="text/javascript" src="$1?' . $tag . '">',
- '<link rel="stylesheet" type="text/css" href="$1?' . $tag . '" />',
+ '<script type="text/javascript" src="$1?' . $tagJs . '">',
+ '<script type="text/javascript" src="$1?' . $tagJs . '">',
+ '<link rel="stylesheet" type="text/css" href="$1?' . $tagCss . '" />',
'$1="index.php?module=$2&amp;action=$3&amp;cb=',
);