From c76462c25ce06ae5df5f486663e75ceb73b5a6ec Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 25 Mar 2009 13:43:45 +0000 Subject: [PATCH] Check for title validity in ApiQueryCategories --- includes/api/ApiQueryCategories.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index d6f61772ee..d8bd1cdc63 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -87,7 +87,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { foreach($params['categories'] as $cat) { $title = Title::newFromText($cat); - if($title->getNamespace() != NS_CATEGORY) + if(!$title || $title->getNamespace() != NS_CATEGORY) $this->setWarning("``$cat'' is not a category"); else $cats[] = $title->getDBkey(); @@ -239,4 +239,4 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { public function getVersion() { return __CLASS__ . ': $Id$'; } -} \ No newline at end of file +} -- 2.20.1