From: Roan Kattouw Date: Fri, 27 Jun 2008 10:37:40 +0000 (+0000) Subject: Fix fatal errors introduced in r36678 X-Git-Tag: 1.31.0-rc.0~46868 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=87711e1bc7c88b3f19abec7cb14384bb4cbcaa46;p=lhc%2Fweb%2Fwiklou.git Fix fatal errors introduced in r36678 --- 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(); }