Index: trunk/phase3/includes/api/ApiQueryBase.php |
— | — | @@ -325,6 +325,8 @@ |
326 | 326 | */ |
327 | 327 | public static function titleToKey($title) { |
328 | 328 | $t = Title::newFromText($title); |
| 329 | + if(!$t) |
| 330 | + $this->dieUsageMsg('invalidtitle', $title); |
329 | 331 | return $t->getDbKey(); |
330 | 332 | } |
331 | 333 | |
— | — | @@ -335,6 +337,9 @@ |
336 | 338 | */ |
337 | 339 | public static function keyToTitle($key) { |
338 | 340 | $t = Title::newFromDbKey($key); |
| 341 | + # This really shouldn't happen but we gotta check anyway |
| 342 | + if(!$t) |
| 343 | + $this->dieUsageMsg('invalidtitle', $key); |
339 | 344 | return $t->getPrefixedText(); |
340 | 345 | } |
341 | 346 | |