From ef6fb5e3bc205c2ee3f8830e773e206af8613e3e Mon Sep 17 00:00:00 2001 From: fliespl Date: Thu, 18 Mar 2021 21:44:01 +0100 Subject: [PATCH] drop nocache & server query string param from theme.css stylesheet Signed-off-by: Arkadiusz Rzadkowolski --- libraries/classes/Config.php | 20 -------------------- libraries/classes/Header.php | 2 -- templates/header.twig | 3 +-- test/classes/ConfigTest.php | 18 ------------------ 4 files changed, 1 insertion(+), 42 deletions(-) diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 53351e4934..7a92c25e77 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -881,26 +881,6 @@ class Config return $this->source; } - /** - * returns a unique value to force a CSS reload if either the config - * or the theme changes - * - * @return int Summary of unix timestamps, to be unique on theme parameters - * change - */ - public function getThemeUniqueValue(): int - { - global $theme; - - return (int) ( - $this->sourceMtime + - $this->defaultSourceMtime + - $this->get('user_preferences_mtime') + - ($theme->mtimeInfo ?? 0) + - ($theme->filesizeInfo ?? 0) - ); - } - /** * checks if upload is enabled */ diff --git a/libraries/classes/Header.php b/libraries/classes/Header.php index 7c4b3c2b00..416907fb4e 100644 --- a/libraries/classes/Header.php +++ b/libraries/classes/Header.php @@ -397,7 +397,6 @@ class Header $this->sendHttpHeaders(); $baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; - $uniqueValue = $GLOBALS['config']->getThemeUniqueValue(); $themePath = $theme instanceof Theme ? $theme->getPath() : ''; $version = self::getVersionParameter(); @@ -455,7 +454,6 @@ class Header 'allow_third_party_framing' => $GLOBALS['cfg']['AllowThirdPartyFraming'], 'is_print_view' => $this->isPrintView, 'base_dir' => $baseDir, - 'unique_value' => $uniqueValue, 'theme_path' => $themePath, 'version' => $version, 'text_dir' => $GLOBALS['text_dir'], diff --git a/templates/header.twig b/templates/header.twig index 2a31ee75fd..f6c2d3a29c 100644 --- a/templates/header.twig +++ b/templates/header.twig @@ -19,8 +19,7 @@ - + {% endif %} {{ title }} diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index a734348eac..fa3e012b47 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -942,24 +942,6 @@ class ConfigTest extends AbstractTestCase $this->assertEquals($this->object->getUserValue('test_val', 'val'), 'val'); } - /** - * Should test getting unique value for theme - * - * @group 32bit-incompatible - */ - public function testGetThemeUniqueValue(): void - { - global $theme; - - $partial_sum = $this->object->sourceMtime + - $this->object->defaultSourceMtime + - $this->object->get('user_preferences_mtime') + - $theme->mtimeInfo + - $theme->filesizeInfo; - - $this->assertEquals($partial_sum, $this->object->getThemeUniqueValue()); - } - /** * Should test checking of config permissions */