r36719 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36718‎ | r36719 | r36720 >
Date:10:37, 27 June 2008
Author:catrope
Status:old
Tags:
Comment:
Fix fatal errors introduced in r36678
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBase.php
@@ -325,6 +325,8 @@
326326 */
327327 public static function titleToKey($title) {
328328 $t = Title::newFromText($title);
 329+ if(!$t)
 330+ $this->dieUsageMsg('invalidtitle', $title);
329331 return $t->getDbKey();
330332 }
331333
@@ -335,6 +337,9 @@
336338 */
337339 public static function keyToTitle($key) {
338340 $t = Title::newFromDbKey($key);
 341+ # This really shouldn't happen but we gotta check anyway
 342+ if(!$t)
 343+ $this->dieUsageMsg('invalidtitle', $key);
339344 return $t->getPrefixedText();
340345 }
341346

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36678Use the proper Title methods in ApiQueryBase::titleToKey() and keyToTitle(). ...catrope15:48, 26 June 2008

Status & tagging log