Merge pull request #16740 from fliespl/patch-2

drop nocache & server query string param from theme.css stylesheet
This commit is contained in:
Maurício Meneghini Fauth 2021-03-20 21:39:49 -03:00 committed by GitHub
commit 427b8b8888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 42 deletions

View File

@ -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
*/

View File

@ -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'],

View File

@ -19,8 +19,7 @@
<link rel="stylesheet" type="text/css" href="{{ base_dir }}js/vendor/codemirror/lib/codemirror.css?{{ version }}">
<link rel="stylesheet" type="text/css" href="{{ base_dir }}js/vendor/codemirror/addon/hint/show-hint.css?{{ version }}">
<link rel="stylesheet" type="text/css" href="{{ base_dir }}js/vendor/codemirror/addon/lint/lint.css?{{ version }}">
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/css/theme{{ text_dir == 'rtl' ? '.rtl' }}.css?{{ version }}&nocache=
{{- unique_value }}{{ text_dir }}{% if server is not empty %}&server={{ server }}{% endif %}">
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/css/theme{{ text_dir == 'rtl' ? '.rtl' }}.css?{{ version }}">
<link rel="stylesheet" type="text/css" href="{{ theme_path }}/css/printview.css?{{ version }}" media="print" id="printcss">
{% endif %}
<title>{{ title }}</title>

View File

@ -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
*/