Last modified: 2014-11-17 10:36:01 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 T19006, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17006 - Blank anchor [[#|anchor link]] should not link to the Main Page
Blank anchor [[#|anchor link]] should not link to the Main Page
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.21.x
All All
: Normal trivial with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/w/index.php?o...
: need-parsertest
: 23799 26766 32728 33437 34545 44270 58647 (view as bug list)
Depends on:
Blocks: 29890
  Show dependency treegraph
 
Reported: 2009-01-13 18:28 UTC by Charlotte Webb
Modified: 2014-11-17 10:36 UTC (History)
15 users (show)

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


Attachments

Description Charlotte Webb 2009-01-13 18:28:13 UTC
[[#]] or [[#|foobar]] links to a null page name rather than a null section. The example links point to http://en.wikipedia.org/wiki/ which redirects to the main page.

(except for [[##]] which points to the current url plus "#.23")

As far as html literalism goes the least astonishing behavior for [[#]] would be to make a link like this <a href="#">#</a>

that would be the same as "#top" except in cases where it is overridden by a javascript onClick attribute (which it is, most times you see anything like this).

course if there's some way to make it turn blue and clickable but not actually do anything that might be best... i'm not sure when this would intentionally be used except when attempting to create a blue link that does nothing ever.

That's how i stumbled upon it after all :-/
Comment 1 Brion Vibber 2009-01-13 18:34:08 UTC
Probably a bad check for fragments somewhere.... perhaps in multiple places. It should indeed be possible to add an empty fragment but _have_ a fragment... which perhaps complicates things. :D
Comment 2 Alex Z. 2009-01-13 21:01:30 UTC
I've tracked it down to Title::getLinkUrl(), the problem is that Title stores fragments without the leading #, then adds it back on when making a URL (Title::getFragmentForURL()), so it doesn't know the difference between a blank fragment and no fragment at all. So when making the URL, it sees no namespace, no text, and no fragment.
Comment 3 Brion Vibber 2009-01-13 21:06:53 UTC
We could use false or null to distinguish between empty string and not-present... but then we have to be more anal about all the checks... or replace the != '' etc with a hasFragment() which'll be easier to remember.
Comment 4 Brion Vibber 2009-01-16 19:00:08 UTC
We could also probably reasonably assume that if we've ended up with an empty title object, it's a self-link with empty fragment, so could handle it as a special case.
Comment 5 Krinkle 2012-07-01 20:46:28 UTC
*** Bug 26766 has been marked as a duplicate of this bug. ***
Comment 6 Krinkle 2012-07-01 20:47:28 UTC
*** Bug 32728 has been marked as a duplicate of this bug. ***
Comment 7 Krinkle 2012-07-01 20:47:37 UTC
*** Bug 23799 has been marked as a duplicate of this bug. ***
Comment 8 Krinkle 2012-07-01 20:47:42 UTC
*** Bug 34545 has been marked as a duplicate of this bug. ***
Comment 9 Krinkle 2012-07-01 20:48:36 UTC
*** Bug 33437 has been marked as a duplicate of this bug. ***
Comment 10 Krinkle 2012-07-01 20:48:57 UTC
*** Bug 38103 has been marked as a duplicate of this bug. ***
Comment 11 Andre Klapper 2013-01-23 09:54:25 UTC
Still valid in 1.21wmf8.
Comment 12 Andre Klapper 2013-01-23 09:54:40 UTC
*** Bug 44270 has been marked as a duplicate of this bug. ***
Comment 13 Danny B. 2013-01-24 13:35:43 UTC
Raising the importance according to the number of dupes - obviously very wanted feature and more and more actual when we create more and more gadgets nowadays.
Comment 14 Bartosz Dziewoński 2014-01-24 18:21:53 UTC
*** Bug 58647 has been marked as a duplicate of this bug. ***
Comment 15 Umherirrender 2014-01-24 20:29:06 UTC
Title::hasFragment as mention by brion in comment 3 was added with Gerrit change #104750, so checking against false or null would be possible (for core)

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


Navigation
Links