Permalink
Browse files

Fix regex in data.uribl.js

An invalid quantor was used, quantors may not omit the number before the comma

Commit 82db2c9 introduced this bug
  • Loading branch information...
1 parent ff67651 commit 063865ba56eadd2f152ffedb063ecc7c7ce73d81 @TimWolla TimWolla committed Nov 22, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugins/data.uribl.js
View
4 plugins/data.uribl.js
@@ -6,7 +6,7 @@ var net_utils = require('./net_utils.js');
// Default regexps to extract the URIs from the message
var numeric_ip = /\w{3,16}:\/+(\S+@)?(\d+|0[xX][0-9A-Fa-f]+)\.(\d+|0[xX][0-9A-Fa-f]+)\.(\d+|0[xX][0-9A-Fa-f]+)\.(\d+|0[xX][0-9A-Fa-f]+)/gi;
-var schemeless = /((?:www\.)?[a-zA-Z0-9][a-zA-Z0-9\-.]{,250}\.(?:aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx|[a-zA-Z]{2}))(?!\w)/gi;
+var schemeless = /((?:www\.)?[a-zA-Z0-9][a-zA-Z0-9\-.]{0,250}\.(?:aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx|[a-zA-Z]{2}))(?!\w)/gi;
var schemed = /(\w{3,16}:\/+(?:\S+@)?([a-zA-Z0-9][a-zA-Z0-9\-.]+\.(?:aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx|[a-zA-Z]{2})))(?!\w)/gi;
var lists;
@@ -33,7 +33,7 @@ exports.register = function() {
// Override regexps if top_level_tlds file is present
if (net_utils.top_level_tlds && Object.keys(net_utils.top_level_tlds).length) {
this.logdebug('Building new regexps from TLD file');
- var re_schemeless = '((?:www\\.)?[a-zA-Z0-9][a-zA-Z0-9\\-.]{,250}\\.(?:' +
+ var re_schemeless = '((?:www\\.)?[a-zA-Z0-9][a-zA-Z0-9\\-.]{0,250}\\.(?:' +
Object.keys(net_utils.top_level_tlds).join('|') + '))(?!\\w)';
schemeless = new RegExp(re_schemeless, 'gi');
var re_schemed = '(\\w{3,16}:\\/+(?:\\S+@)?([a-zA-Z0-9][a-zA-Z0-9\\-.]+\\.(?:' +

0 comments on commit 063865b

Please sign in to comment.