hashchange: Handle trailing slashes in narrowing URLs.

Fixes #9305.
Empty operators are not allowed while parsing narrowing URLs.
`parse_narrow` stops parsing further if it encounters an empty string
operator.
This commit is contained in:
Shubham Padia
2018-05-15 19:29:50 +05:30
committed by Tim Abbott
parent 83ee8211a8
commit f0d874d51f
2 changed files with 17 additions and 0 deletions

View File

@@ -77,6 +77,11 @@ exports.parse_narrow = function (hash) {
// but the user might write one.
try {
var operator = hash_util.decodeHashComponent(hash[i]);
// Do not parse further if empty operator encountered.
if (operator === '') {
break;
}
var operand = hash_util.decode_operand(operator, hash[i+1] || '');
var negated = false;
if (operator[0] === '-') {