Skip to content

Commit

Permalink
Fix hash validation
Browse files Browse the repository at this point in the history
- use copy of hash to avoid race condition
- stricter regex to match whole string

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Aug 18, 2016
1 parent 9b8094b commit 9473688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ 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) {
setTab(location.hash.substr(5));
if (prev_hash.match(/^#tab_[a-zA-Z0-9_]+$/) && $('#' + prev_hash.substr(5)).length) {
setTab(prev_hash.substr(5));
}
}
};
Expand Down

0 comments on commit 9473688

Please sign in to comment.