Last modified: 2012-02-05 20:18:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36179, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34179 - Unexpectedly blocks all protocols, not just http/https
Unexpectedly blocks all protocols, not just http/https
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Spam Blacklist (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-03 04:09 UTC by Brad Jorsch
Modified: 2012-02-05 20:18 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brad Jorsch 2012-02-03 04:09:17 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?
Comment 1 Chad H. 2012-02-03 04:15:09 UTC
Are there actual cases where you'd want to block http/https links but allow another protocol like gopher?
Comment 2 Brad Jorsch 2012-02-03 04:18:48 UTC
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 "//".
Comment 3 Sam Reed (reedy) 2012-02-03 20:09:41 UTC
$regexStart = '/(?:https?:)\/\/+[a-z0-9_\-.]*(';

would fix it, by not making the whole protocol bit optional
Comment 4 Sam Reed (reedy) 2012-02-03 20:15:38 UTC
1.18wmf1 r110682
trunk r110683
Comment 5 Brad Jorsch 2012-02-05 20:18:46 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links