diff options
Diffstat (limited to 'js/ajax.js')
-rw-r--r-- | js/ajax.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/js/ajax.js b/js/ajax.js index d8df310a46..d8b0a3ba7d 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -920,9 +920,16 @@ AJAX.setUrlHash = (function (jQuery, window) { if (window.location.hash.substring(0, 8) == '#PMAURL-') { // We have a valid hash, let's redirect the user // to the page that it's pointing to - window.location = window.location.hash.substring( - window.location.hash.indexOf(':') + 1 - ); + var colon_position = window.location.hash.indexOf(':'); + var questionmark_position = window.location.hash.indexOf('?'); + if (colon_position != -1 && questionmark_position != -1 && colon_position < questionmark_position) { + var hash_url = window.location.hash.substring(colon_position + 1, questionmark_position); + if (PMA_gotoWhitelist.indexOf(hash_url) != -1) { + window.location = window.location.hash.substring( + colon_position + 1 + ); + } + } } else { // We don't have a valid hash, so we'll set it up // when the page finishes loading |