From: Aryeh Gregor Date: Wed, 19 Mar 2008 15:53:48 +0000 (+0000) Subject: Fix an error for categories named literally "Project:" or some similarly weird thing... X-Git-Tag: 1.31.0-rc.0~48975 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=8fc8c4530de869f8e1d71fdabcb54b5afb36220d;p=lhc%2Fweb%2Fwiklou.git 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. --- 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; }