From 19f1fa7576a7f33de0845e4f00ed9a13f73b8476 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 14 Nov 2008 00:44:08 +0000 Subject: [PATCH] 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. --- includes/specials/SpecialFilepath.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); -- 2.20.1