From 3ef6201bd6d43eed7f360bb2ead22ef7c484381e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 18 Aug 2016 11:25:21 +0200 Subject: [PATCH] Fix hash validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use copy of hash to avoid race condition - stricter regex to match whole string Signed-off-by: Michal Čihař --- js/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/config.js b/js/config.js index 6630dd6c7c..3a07504061 100644 --- a/js/config.js +++ b/js/config.js @@ -624,9 +624,9 @@ 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_]+/)) { + if (prev_hash.match(/^#tab_[a-zA-Z0-9_]+$/)) { // session ID is sometimes appended here - var hash = location.hash.substr(5).split('&')[0]; + var hash = prev_hash.substr(5).split('&')[0]; if ($('#' + hash).length) { setTab(hash); }