Last modified: 2010-05-15 15:38:54 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 T5090, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3090 - External links other than http:// break image captions
External links other than http:// break image captions
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.5.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-09 23:49 UTC by Rowan Collins [IMSoP]
Modified: 2010-05-15 15:38 UTC (History)
0 users

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


Attachments
Patch to temporarily mask *all* external links inside image captions (1.11 KB, patch)
2005-08-09 23:52 UTC, Rowan Collins [IMSoP]
Details
tweaked version; mask all external links, but make sure not to double-mask them (1.44 KB, patch)
2005-08-10 12:41 UTC, Rowan Collins [IMSoP]
Details
patch to add a parsertest for this bug (1.65 KB, patch)
2005-08-12 22:22 UTC, Rowan Collins [IMSoP]
Details
url masking patch that doesn't choke the patch utility (1.44 KB, patch)
2005-08-12 22:25 UTC, Rowan Collins [IMSoP]
Details

Description Rowan Collins [IMSoP] 2005-08-09 23:49:24 UTC
An image caption containing a non-http external link (e.g. irc://, https://), of
any kind (free, labelled, bracketted), breaks - the old external link getting
parsed multiple times problem. The only reason http:// links *don't* break is
because there's a special case that temporarily masks them as http-noparse://.
Expanding this masking to all protocols should fix the problem. (Patch follows)
Comment 1 Rowan Collins [IMSoP] 2005-08-09 23:52:10 UTC
Created attachment 765 [details]
Patch to temporarily mask *all* external links inside image captions

This patch just replaces the http:// -> http-noparse:// mask with one based on
the $wgUrlProtocols regex; it uses UNIQ_PREFIX."NOPARSE" at the beginning so
that the protocol is effectively masked without having to insert text before
the colon (impossible using that regex).
Comment 2 Rowan Collins [IMSoP] 2005-08-10 12:41:58 UTC
Created attachment 766 [details]
tweaked version; mask all external links, but make sure not to double-mask them

Since this hasn't been committed yet, I'll just add a quick tweak: to avoid the
minor possibility of double-masking a URL somewhere, or some other hideous
confusion of that sort, match a "\b" at the beginning of the URL
Comment 3 Rowan Collins [IMSoP] 2005-08-12 22:22:31 UTC
Created attachment 778 [details]
patch to add a parsertest for this bug
Comment 4 Rowan Collins [IMSoP] 2005-08-12 22:25:14 UTC
Created attachment 779 [details]
url masking patch that doesn't choke the patch utility

[Oops - never manually edit a diff file, at least not without either knowing
what you're doing, or testing that it still works as a patch afterwards.
Sorry.]
Comment 5 Rowan Collins [IMSoP] 2005-08-20 12:52:40 UTC
I've committed both the parsertest and the fix to CVS HEAD and the 1.5 branch.

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


Navigation
Links