From 8262b9ec7001cd32609272899490e488bbcbb69c Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 20 Sep 2014 10:47:30 -0400 Subject: [PATCH] code review: safer test --- js/ublock.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ublock.js b/js/ublock.js index e936d4430..ddc000fad 100644 --- a/js/ublock.js +++ b/js/ublock.js @@ -231,11 +231,11 @@ if ( pos === -1 ) { return type; } - var ext = path.slice(pos); - if ( '.eot.ttf.otf.svg.woff'.indexOf(ext) !== -1 ) { + var ext = path.slice(pos) + '.'; + if ( '.eot.ttf.otf.svg.woff.'.indexOf(ext) !== -1 ) { return 'stylesheet'; } - if ( '.ico.png.gif.jpg.jpeg'.indexOf(ext) !== -1 ) { + if ( '.ico.png.gif.jpg.jpeg.'.indexOf(ext) !== -1 ) { return 'image'; } return type;