From: Tim Starling Date: Fri, 14 Nov 2008 00:44:08 +0000 (+0000) Subject: Fix incorrect use of Title::newFromText(). That function lets the user choose the... X-Git-Tag: 1.31.0-rc.0~44350 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=19f1fa7576a7f33de0845e4f00ed9a13f73b8476;p=lhc%2Fweb%2Fwiklou.git Fix incorrect use of Title::newFromText(). That function lets the user choose the namespace using a title with colons, to force the namespace you must use Title::makeTitleSafe(). Images are always in the image namespace. --- diff --git a/includes/specials/SpecialFilepath.php b/includes/specials/SpecialFilepath.php index a2ba3e57a1..af80e2f6f2 100644 --- a/includes/specials/SpecialFilepath.php +++ b/includes/specials/SpecialFilepath.php @@ -9,7 +9,7 @@ function wfSpecialFilepath( $par ) { $file = isset( $par ) ? $par : $wgRequest->getText( 'file' ); - $title = Title::newFromText( $file, NS_IMAGE ); + $title = Title::makeTitleSafe( NS_IMAGE, $file ); if ( ! $title instanceof Title || $title->getNamespace() != NS_IMAGE ) { $cform = new FilepathForm( $title );