diff --git a/ChangeLog b/ChangeLog index d245a8cdfb..343f95e8bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -70,6 +70,8 @@ phpMyAdmin - ChangeLog - issue #11940 Silent errors from checking local documentation - issue #11944 Fixed error on servers with disabled php_uname - issue #11946 Correctly store and report file upload errors +- issue #11948 Avoid javascript errors on invalid location hash +- issue #11950 Fix PHP warning on configuration errors 4.5.4.1 (2016-01-29) - issue #11892 Error with PMA 4.4.15.3 diff --git a/js/config.js b/js/config.js index 61e4481296..d3d5d71f23 100644 --- a/js/config.js +++ b/js/config.js @@ -600,7 +600,7 @@ AJAX.registerOnload('config.js', function () { var tab_check_fnc = function () { if (location.hash != prev_hash) { prev_hash = location.hash; - if (location.hash.match(/^#tab_.+/) && $('#' + location.hash.substr(5)).length) { + if (location.hash.match(/^#tab_[a-zA-Z0-9_]+/) && $('#' + location.hash.substr(5)).length) { setTab(location.hash.substr(5)); } } diff --git a/libraries/common.inc.php b/libraries/common.inc.php index fb2cd8f300..57be432b4d 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -152,6 +152,20 @@ foreach (get_defined_vars() as $key => $value) { } unset($key, $value, $variables_whitelist); +/** + * @global boolean $GLOBALS['is_ajax_request'] + * @todo should this be moved to the variables init section above? + * + * Check if the current request is an AJAX request, and set is_ajax_request + * accordingly. Suppress headers, footers and unnecessary output if set to + * true + */ +if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { + $GLOBALS['is_ajax_request'] = true; +} else { + $GLOBALS['is_ajax_request'] = false; +} + /** * Subforms - some functions need to be called by form, cause of the limited URL @@ -993,20 +1007,6 @@ $GLOBALS['PMA_Config']->set('default_server', ''); /* Tell tracker that it can actually work */ Tracker::enable(); -/** - * @global boolean $GLOBALS['is_ajax_request'] - * @todo should this be moved to the variables init section above? - * - * Check if the current request is an AJAX request, and set is_ajax_request - * accordingly. Suppress headers, footers and unnecessary output if set to - * true - */ -if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { - $GLOBALS['is_ajax_request'] = true; -} else { - $GLOBALS['is_ajax_request'] = false; -} - if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { PMA_fatalError(__("GLOBALS overwrite attempt")); }