Page MenuHomePhabricator

Broken links to special pages with action=render
Closed, ResolvedPublic

Description

Author: hheitkoetter

Description:
Using action=render on a page that links to a special page (e.g.
[[Special:Allpages]]) results in a weird link in the output (see URL): obviously
the link is parsed twice, as two html link-tags are visible.

Cause: this bug arises from the special treatment of links to Specialpages in
combination with the full links (incl $wgServerUrl) in the href-attribute.
Unlike normal links, those to special pages are not replaced by a linkholder but
inserted directly (via Skin::makeKnownLinkObj). With $action == 'render' links
are inserted with $wgServerUrl (which is useful). After this parsing of the
internal links the external links are parsed. The value in the href-attribute is
now considered as a free external link and replaced with a new link-tag of class
'external free'.

Solution: ?, perhaps the regex '/(\b(?:'.$wgUrlProtocols.'))/S' in
Parser:replaceExternalLinks could be adjusted?


Version: 1.6.x
Severity: normal
URL: http://de.wikipedia.org/wiki/Benutzer:HenHei/render

Details

Reference
bz3495

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:49 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3495.
bzimport added a subscriber: Unknown Object (MLST).

This also occurs for [[:Image:xxx]] links, for the same reason. This could
probably be fixed by replacing makeKnownLinkObj() with makeLinkHolder(), as is
done with interwiki links.

rowan.collins wrote:

There's also the dummy links used for commons images and links inside captions,
using UNIQ_PREFIX."NOPARSE" [That should probably happen in a function, btw, so
it can be changed in one place, without risk of doom]. Don't know what the
advantages and disadvantages of using each in these cases are.

wiki.bugzilla wrote:

(In reply to comment #1)

not really a duplicate, but please compare bug 2726
regarding broken image links from the Commons

  • This bug has been marked as a duplicate of 3397 ***