API:
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index 31658b1..b1e6752 100644 (file)
@@ -326,7 +326,12 @@ abstract class ApiQueryBase extends ApiBase {
        public function titleToKey($title) {
                $t = Title::newFromText($title);
                if(!$t)
+               {
+                       # Don't throw an error if we got an empty string
+                       if($title == '')
+                               return '';
                        $this->dieUsageMsg(array('invalidtitle', $title));
+               }
                return $t->getDbKey();
        }
 
@@ -339,7 +344,12 @@ abstract class ApiQueryBase extends ApiBase {
                $t = Title::newFromDbKey($key);
                # This really shouldn't happen but we gotta check anyway
                if(!$t)
+               {
+                       # Don't throw an error if we got an empty string
+                       if($key == '')
+                               return '';
                        $this->dieUsageMsg(array('invalidtitle', $key));
+               }
                return $t->getPrefixedText();
        }