Last modified: 2013-10-31 17:25:35 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 T5695, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3695 - External URL syntax cannot handle square brackets
External URL syntax cannot handle square brackets
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low normal with 4 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://bugzilla.wikimedia.org/show_bu...
:
: 19411 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-13 10:19 UTC by lɛʁi לערי ריינהארט
Modified: 2013-10-31 17:25 UTC (History)
7 users (show)

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


Attachments

Description lɛʁi לערי ריינהארט 2005-10-13 10:19:47 UTC
from bug 2095 comment 8
-----------------------
Example case (from en.wikipedia.org/wiki/Solar_eclipse, external links section:
«
<nowiki>
[http://eclipse.span.ch/eclipse8april.htm Pictures of the most recent eclipse of
[[8 April]] [[2005]]]
</nowiki>
»
should give
«
<nowiki>
Pictures of the most recent eclipse of [[8 April]] [[2005]]
</nowiki>
»
as link text, but gives instead
«
<nowiki>
[http://eclipse.span.ch/eclipse8april.htm Pictures of the most recent eclipse of
2005 ]
</nowiki>
»
with the http: part as an external link, and the closing bracket as a link to "8
April".
-----------------------

note: The example describes "nested links": "wiki links" inside "external links"
. This is somthing new.

To my understanding the most usefull would be to change
[http://eclipse.span.ch/eclipse8april.htm Pictures of the most recent eclipse of
[[8 April]] [[2005]]]

to

[http://eclipse.span.ch/eclipse8april.htm Pictures of the most recent eclipse of]
[[8 April]] [[2005]]

This should be done by users / contributors. Would be great if the MediaWiki
software could generate a warning.

Rehards Reinahrdt [[user:gangleri]]
Comment 1 Gabriel Wicke 2006-03-24 17:36:42 UTC
I've added a hack that fixes this for one embedded internal link if tidy is
disabled. 

There are many nesting-related bugs in the current parser. It's impossible to
fix them all without rewriting the parser to a real state machine.
Comment 2 Simon Walker 2008-12-22 00:47:53 UTC
(In reply to comment #1)
> There are many nesting-related bugs in the current parser. It's impossible to
> fix them all without rewriting the parser to a real state machine.

Has this been fixed with the new parser?
Comment 3 Chad H. 2009-06-26 13:36:36 UTC
*** Bug 19411 has been marked as a duplicate of this bug. ***
Comment 4 Tisza Gergő 2009-06-26 16:11:33 UTC
*** Bug 19411 has been marked as a duplicate of this bug. ***
Comment 5 Tisza Gergő 2009-06-26 16:17:22 UTC
Renaming and bumping up severity: the bug also occurs when the square brackets are part of the URL, which is more problematic, because some frameworks use brackets in GET parameters. For example, 

[http://www.danishliterature.info/index.php?id=2092&no_cache=1&tx_lfforfatter_pi2[stage]=1&tx_lfforfatter_pi2[uid]=109&tx_lfforfatter_pi2[lang]=_eng Jørgen-Frantz Jacobsen]

should give 

<a href="http://www.danishliterature.info/index.php?id=2092&no_cache=1&tx_lfforfatter_pi2[stage]=1&tx_lfforfatter_pi2[uid]=109&tx_lfforfatter_pi2[lang]=_eng">Jørgen-Frantz Jacobsen</a>

but the actual result is

<a href="http://www.danishliterature.info/index.php?id=2092&no_cache=1&tx_lfforfatter_pi2">[stage</a>=1&tx_lfforfatter_pi2[uid]=109&tx_lfforfatter_pi2[lang]=_eng Jørgen-Frantz Jacobsen]

Automatic URLs (ie. just pasting the URL in wikitext without any formatting) have the same problem.
Comment 6 Tisza Gergő 2009-06-26 16:22:51 UTC
Replacing [ and ] in the URL with %5B and %5D usually helps, but is technically incorrect because these are reserved characters and shouldn't be urlencoded (nor do most browsers urlencode them when you copy the URL from the address bar), and it depends on the whim of the url processor whether the urlencoded version will still point to the same resource.

A possible hack would be to change the regexp identifying the URL part: one could take advantage of the fact that square brackets are in practice always balanced in an url, aren't usually nested and are never at the end. It might be possible to add something like (\[[-\w_+%]*\][-\w_+%?=]+)? to the end of the URL regex to handle such links and still not mess up [1]-style automatically numbered links.
Comment 7 Mark A. Hershberger 2011-04-12 16:02:08 UTC
Not going to fix this with the current MW core.  Punting to the new editor that Brion has planned.  The new editor should automatically encode pasted URLs

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


Navigation
Links