From 8fc8c4530de869f8e1d71fdabcb54b5afb36220d Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 19 Mar 2008 15:53:48 +0000 Subject: [PATCH] Fix an error for categories named literally "Project:" or some similarly weird thing. I thought that's not a legal title, but I'm told otherwise. Is there a better way to do this than manually prefixing "Category:"? The second parameter to newFromText is ignored if there are any prefixes, according to the docs. --- includes/Category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Category.php b/includes/Category.php index e924b5eeba..b22f094232 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -50,7 +50,7 @@ abstract class CategoryListBase { * @return mixed Normalized name, or false if the name was invalid. */ private static function setNamesCallback( $name ) { - $title = Title::newFromText( $name ); + $title = Title::newFromText( "Category:$name" ); if( !is_object( $title ) ) { return false; } -- 2.20.1