Fix fatal errors introduced in r36678
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 27 Jun 2008 10:37:40 +0000 (10:37 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 27 Jun 2008 10:37:40 +0000 (10:37 +0000)
includes/api/ApiQueryBase.php

index b17cfab..fe68e6f 100644 (file)
@@ -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();
        }