From fc8486094c94df2250993d9b90887f36990661f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 26 Apr 2016 10:29:58 +0200 Subject: [PATCH] Fixed config tab persistence errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The URL hash can get appended php session ID breaking the hash lookup. Fixes #12215 Signed-off-by: Michal Čihař --- ChangeLog | 1 + js/config.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcf9d247be..68b2fd35b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ phpMyAdmin - ChangeLog - issue #12206 Fixed loading of configuration file - issue #12204 Check if sessions are working and report failures - issue #12211 non-clickable initial letter for users / and can't modify users with MySQL 5.7.12 +- issue #12215 Fixed config tab persistence errors 4.6.0.0 (2016-03-22) + issue #11456 Disabled storage engines diff --git a/js/config.js b/js/config.js index 43309b1b93..3fcc95957a 100644 --- a/js/config.js +++ b/js/config.js @@ -624,8 +624,12 @@ AJAX.registerOnload('config.js', function () { var tab_check_fnc = function () { if (location.hash != prev_hash) { prev_hash = location.hash; - if (location.hash.match(/^#tab_[a-zA-Z0-9_]+/) && $('#' + location.hash.substr(5)).length) { - setTab(location.hash.substr(5)); + if (location.hash.match(/^#tab_[a-zA-Z0-9_]+/)) { + // session ID is sometimes appended here + var hash = location.hash.substr(5).split('&')[0]; + if ($('#' + hash).length) { + setTab(hash); + } } } };