From: Andrew Garrett Date: Wed, 25 Mar 2009 13:43:45 +0000 (+0000) Subject: Check for title validity in ApiQueryCategories X-Git-Tag: 1.31.0-rc.0~42366 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=c76462c25ce06ae5df5f486663e75ceb73b5a6ec;p=lhc%2Fweb%2Fwiklou.git Check for title validity in ApiQueryCategories --- 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 +}