From ea47cae003e7298cb91135645bb34fc0f57f860d Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 9 May 2017 08:58:30 -0400 Subject: [PATCH] fix #2599 --- src/js/static-net-filtering.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index a33f370ba..9f7c0d277 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -1443,10 +1443,13 @@ FilterParser.prototype.parse = function(raw) { s = s.slice(2); // convert hostname to punycode if needed + // https://github.com/gorhill/uBlock/issues/2599 if ( this.reHasUnicode.test(s) ) { var matches = this.reIsolateHostname.exec(s); if ( matches ) { - s = matches[1] + punycode.toASCII(matches[2]) + matches[3]; + s = (matches[1] !== undefined ? matches[1] : '') + + punycode.toASCII(matches[2]) + + matches[3]; //console.debug('µBlock.staticNetFilteringEngine/FilterParser.parse():', raw, '=', s); } }