From 3c7d2544b9c71891ed412b69e942f1cdfb9580e0 Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@statuscode.ch>
Date: Thu, 18 Aug 2016 12:34:55 +0200
Subject: [PATCH] Add cache buster to left menu bar

---
 core/templates/layout.user.php | 4 ++--
 lib/private/TemplateLayout.php | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 2c0d3f05297..a5025d5beda 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -115,7 +115,7 @@
 							<?php if( $entry['active'] ): ?> class="active"<?php endif; ?>>
 							<svg width="32" height="32" viewBox="0 0 32 32">
 								<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
-								<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="<?php print_unescaped($entry['icon']); ?>"  class="app-icon"></image>
+								<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"  class="app-icon"></image>
 							</svg>
 							<div class="icon-loading-dark" style="display:none;"></div>
 							<span>
@@ -133,7 +133,7 @@
 							<?php if( $_['appsmanagement_active'] ): ?> class="active"<?php endif; ?>>
 							<svg width="32" height="32" viewBox="0 0 32 32" class="app-icon">
 								<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
-								<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="<?php print_unescaped(image_path('settings', 'apps.svg')); ?>"></image>
+								<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="<?php print_unescaped(image_path('settings', 'apps.svg') . '?v=' . $_['versionHash']); ?>"></image>
 							</svg>
 							<div class="icon-loading-dark" style="display:none;"></div>
 							<span>
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 9e3bbf88470..7e5c120717f 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -153,6 +153,7 @@ class TemplateLayout extends \OC_Template {
 		$cssFiles = self::findStylesheetFiles(\OC_Util::$styles);
 		$this->assign('cssfiles', array());
 		$this->assign('printcssfiles', []);
+		$this->assign('versionHash', self::$versionHash);
 		foreach($cssFiles as $info) {
 			$web = $info[1];
 			$file = $info[2];
-- 
GitLab