Page MenuHomePhabricator

Don't manually build URLs in MobileFrontend extension
Closed, ResolvedPublic

Description

MW has wrapper functions for querystring building etc

It saves having to do stuff like

$delimiter = ( strpos( $mobileViewUrl, "?" ) !== false ) ? "&" : "?";

And also makes sure that all parameters are properly encoded

As per a request on #wikimedia-tech where this was giving validation errors

<li id="mobileview"><a href='/w/index.php?title=Datei%3ALogo_African_Pygmy_Goat.png&action=edit&useFormat=mobile'>Mobile View</a></li>

r93561


Version: unspecified
Severity: normal

Details

Reference
bz30142

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:58 PM
bzimport set Reference to bz30142.
bzimport added a subscriber: Unknown Object (MLST).
		$mobileViewUrl = $wgRequest->getRequestURL();
		$delimiter = ( strpos( $mobileViewUrl, "?" ) !== false ) ? "&" : "?";
		$mobileViewUrl .= $delimiter . 'useFormat=mobile';
		$mobileViewUrl = htmlspecialchars( $mobileViewUrl );

even

That particular case is already fixed in r93591. But there a few more problems around.