diff --git a/libraries/core.lib.php b/libraries/core.lib.php index a3d80f5be..c2c82fb29 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -673,4 +673,19 @@ function PMA_linkURL($url) { return './url.php?url=' . $url; } } + +/** + * Returns HTML code to include javascript file. + * + * @param string $url Location of javascript, relative to js/ folder. + * + * @return string HTML code for javascript inclusion. + */ +function PMA_includeJS($url) { + if (strpos($js_script_file, '?') === FALSE) { + return '' . "\n"; + } else { + return '' . "\n"; + } +} ?> diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php index 76b0852d5..a5be940be 100644 --- a/libraries/header_scripts.inc.php +++ b/libraries/header_scripts.inc.php @@ -47,11 +47,7 @@ $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params); // avoid loading twice a js file $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']); foreach ($GLOBALS['js_include'] as $js_script_file) { - if (strpos($js_script_file, '?') === FALSE) { - echo '' . "\n"; - } else { - echo '' . "\n"; - } + echo PMA_includeJS($js_script_file); } ?>