From 441f9eac66b19fe8c734628e85ee790e76150da0 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 14 Aug 2013 15:58:13 -0700 Subject: [PATCH] Remove the possibility of accidentally matching .jpg with .jp --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Linkification/Linkify.coffee | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 8e0b17e34..4dc5426de 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4422,7 +4422,7 @@ if (g.VIEW === 'catalog' || !Conf['Linkify']) { return; } - this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i; + this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)(?![\d\w])|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i; if (Conf['Comment Expansion']) { ExpandComment.callbacks.push(this.node); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 3dd87943f..1e30e61da 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4431,7 +4431,7 @@ if (g.VIEW === 'catalog' || !Conf['Linkify']) { return; } - this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i; + this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)(?![\d\w])|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i; if (Conf['Comment Expansion']) { ExpandComment.callbacks.push(this.node); } diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index dbc759a00..b37b19af2 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -14,8 +14,8 @@ Linkify = # This should account for virtually all links posted without www or http: # If it misses any, screw it. No, I will not add canv.as [-a-z\d.]+[.]( - com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info - ) + com|net|org|jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info + )(?![\d\w]) | # IPv4 Addresses [\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}