r102941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102940‎ | r102941 | r102942 >
Date:06:58, 14 November 2011
Author:ialex
Status:ok
Tags:
Comment:
If there's already a Title object available, then use it directly instead with "new Article( $title )" instead of using Article::newFromID()
Modified paths:
  • /trunk/extensions/TrustedMath/TrustedMath_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TrustedMath/TrustedMath_body.php
@@ -17,8 +17,8 @@
1818 * @param Title $title Title of the article
1919 */
2020 public static function newFromTitle( $title ) {
21 - $text = Article::newFromId( $title->getArticleId() )->getRawText();
22 - return new self( $text );
 21+ $article = new Article( $title, 0 );
 22+ return new self( $article->getRawText() );
2323 }
2424
2525 protected $text = null;

Status & tagging log