r50424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50423‎ | r50424 | r50425 >
Date:09:40, 10 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Bug and php warning fix
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/TranslatablePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/TranslatablePage.php
@@ -220,6 +220,7 @@
221221 return $this->getTag( 'tp:tag' );
222222 }
223223
 224+ // Returns false if not found
224225 protected function getTag( $tag, $dbt = DB_SLAVE ) {
225226 $db = wfGetDB( $dbt );
226227
@@ -378,7 +379,7 @@
379380 $page = TranslatablePage::newFromTitle(
380381 self::changeTitleText( $title, $title->getBaseText() ) );
381382
382 - if ( $page->getMarkedTag() === null ) return false;
 383+ if ( $page->getMarkedTag() === false ) return false;
383384 return $page;
384385 }
385386
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -382,7 +382,8 @@
383383
384384 // Get the translation percentage
385385 $pers = $page->getTranslationPercentages();
386 - $per = $pers[$title->getSubpageText()] * 100;
 386+ $per = @$pers[$title->getSubpageText()];
 387+ $per = ($per === null) ? 0 : $per * 100;
387388 $titleText = $page->getTitle()->getText();
388389 $url = $page->getTranslationUrl( $title->getSubpageText() );
389390

Status & tagging log