r69433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69432‎ | r69433 | r69434 >
Date:19:06, 16 July 2010
Author:yaron
Status:deferred
Tags:
Comment:
Changed code to only call $parser->getTitle() once - possible fix for incorrect-namespaces bug
Modified paths:
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php
@@ -236,8 +236,9 @@
237237 }
238238
239239 public static function doSetInternal( &$parser ) {
240 - $mainPageFullName = $parser->getTitle()->getText();
241 - if ( ( $nsText = $parser->getTitle()->getNsText() ) != '' ) {
 240+ $title = $parser->getTitle();
 241+ $mainPageFullName = $title->getText();
 242+ if ( ( $nsText = $title->getNsText() ) != '' ) {
242243 $mainPageFullName = $nsText . ':' . $mainPageFullName;
243244 }
244245
@@ -256,7 +257,7 @@
257258 $curObjectNum = self::$mInternalObjectIndex;
258259 $params = func_get_args();
259260 array_shift( $params ); // we already know the $parser...
260 - $internalObject = new SIOInternalObject( $parser->getTitle(), $curObjectNum );
 261+ $internalObject = new SIOInternalObject( $title, $curObjectNum );
261262 $objToPagePropName = array_shift( $params );
262263 $internalObject->addPropertyAndValue( $objToPagePropName, self::$mCurPageFullName );
263264 foreach ( $params as $param ) {

Status & tagging log