Page MenuHomePhabricator

Urls to pages are not htmlspecialcharized
Closed, ResolvedPublic

Description

Author: aik.bold

Description:
When listing pages using DPL query and page_title in database is named like "test_&_test2" amp; is lost in name and link to not existing page is build.

Fix:
if ($bEscapeLinks && ($pageNamespace==14 || $pageNamespace==6) ) {

	        // links to categories or images need an additional ":"
			$articleLink = '[[:'.htmlspecialchars($title->getPrefixedText()).'|'.htmlspecialchars( $wgContLang->convert( $sTitleText ) ).']]';
        } else {
			$articleLink = '[['.htmlspecialchars($title->getPrefixedText()).'|'.htmlspecialchars( $wgContLang->convert( $sTitleText ) ).']]';
		}
		$dplArticle->mLink = $articleLink;

This one of possible fixes: add htmlspecialchars call to name and url when building resulting wikitext.


Version: unspecified
Severity: minor
Platform: PC

Details

Reference
bz12437

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:56 PM
bzimport set Reference to bz12437.
bzimport added a subscriber: Unknown Object (MLST).

Duping this to bug 3097. With the illegal non-round-trippable titles now forbidden, round-tripping issues such as this become a non-issue.

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