Last modified: 2012-02-05 20:18:46 UTC
Since the fix for bug 33985, the spam blacklist will now block links for all protocols, not just http or https as documented. Is there any reason not to use the 'm' flag and anchor the regex?
Are there actual cases where you'd want to block http/https links but allow another protocol like gopher?
Enwiki had a broken entry for irc.freenode.net that suddenly started blocking external links to irc://irc.freenode.net/. In this case the blacklist entry was useless anyway. If the solution to the bug is to explicitly change the behavior of the extension to block all protocols, fine with me. But right now it is documented at [[mw:Extension:SpamBlacklist]] that it matches http and https protocols, not all protocols that include the "//".
$regexStart = '/(?:https?:)\/\/+[a-z0-9_\-.]*('; would fix it, by not making the whole protocol bit optional
1.18wmf1 r110682 trunk r110683
(In reply to comment #3) > $regexStart = '/(?:https?:)\/\/+[a-z0-9_\-.]*('; > > would fix it, by not making the whole protocol bit optional That re-opens bug 33985. What probably needs to be done is something like $regexStart = '/^(?:https?:)?\/\/+[a-z0-9_\-.]*('; so (in combination with the 'm' flag already included in $regexEnd) it only matches at the start of each line, but I don't have time right now to verify that works. At a glance it looks like it'll break detecting links in edit summaries, unless the link is at the start of the edit summary.