From 87711e1bc7c88b3f19abec7cb14384bb4cbcaa46 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 27 Jun 2008 10:37:40 +0000 Subject: [PATCH] Fix fatal errors introduced in r36678 --- includes/api/ApiQueryBase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index b17cfabe47..fe68e6fc01 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -325,6 +325,8 @@ abstract class ApiQueryBase extends ApiBase { */ public static function titleToKey($title) { $t = Title::newFromText($title); + if(!$t) + $this->dieUsageMsg('invalidtitle', $title); return $t->getDbKey(); } @@ -335,6 +337,9 @@ abstract class ApiQueryBase extends ApiBase { */ public static function keyToTitle($key) { $t = Title::newFromDbKey($key); + # This really shouldn't happen but we gotta check anyway + if(!$t) + $this->dieUsageMsg('invalidtitle', $key); return $t->getPrefixedText(); } -- 2.20.1