Merge branch 'QA_4_7'

This commit is contained in:
Michal Čihař 2017-06-08 16:14:05 +02:00
commit 61e02b43a8
2 changed files with 8 additions and 11 deletions

View File

@ -150,9 +150,7 @@ class Header
// Localised strings
$this->_scripts->addFile('jquery/jquery.min.js');
$this->_scripts->addFile('jquery/jquery-migrate-3.0.0.js');
$this->_scripts->addFile(
'whitelist.php' . URL::getCommon(), false, true
);
$this->_scripts->addFile('whitelist.php');
$this->_scripts->addFile('sprintf.js');
$this->_scripts->addFile('ajax.js');
$this->_scripts->addFile('keyhandler.js');
@ -179,7 +177,7 @@ class Header
// Here would not be a good place to add CodeMirror because
// the user preferences have not been merged at this point
$this->_scripts->addFile('messages.php' . URL::getCommon());
$this->_scripts->addFile('messages.php');
// Append the theme id to this url to invalidate
// the cache on a theme change. Though this might be
// unavailable for fatal errors.
@ -188,9 +186,7 @@ class Header
} else {
$theme_id = 'default';
}
$this->_scripts->addFile(
'get_image.js.php?theme=' . $theme_id
);
$this->_scripts->addFile('get_image.js.php', false, array('theme' => $theme_id));
$this->_scripts->addFile('config.js');
$this->_scripts->addFile('doclinks.js');
$this->_scripts->addFile('functions.js');

View File

@ -48,9 +48,8 @@ class Scripts
$scripts = array();
$separator = URL::getArgSeparator();
foreach ($files as $value) {
if (mb_strpos($value['filename'], "?") !== false) {
$file_name = $value['filename'] . $separator
. Header::getVersionParameter();
if (mb_strpos($value['filename'], ".php") !== false) {
$file_name = $value['filename'] . URL::getCommon($value['params'] + array('v' => PMA_VERSION));
if ($value['before_statics'] === true) {
$first_dynamic_scripts
.= "<script data-cfasync='false' type='text/javascript' "
@ -108,7 +107,8 @@ class Scripts
*/
public function addFile(
$filename,
$before_statics = false
$before_statics = false,
$params = array()
) {
$hash = md5($filename);
if (!empty($this->_files[$hash])) {
@ -119,6 +119,7 @@ class Scripts
$this->_files[$hash] = array(
'has_onload' => $has_onload,
'filename' => $filename,
'params' => $params,
'before_statics' => $before_statics
);
}