r40493 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40492‎ | r40493 | r40494 >
Date:14:57, 5 September 2008
Author:catrope
Status:old
Tags:
Comment:
ConfirmEdit: Fix use of $wgTitle, should fix bug 15420
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php
@@ -318,8 +318,8 @@
319319 } else {
320320 // Get link changes in the slowest way known to man
321321 $oldtext = $this->loadText( $editPage, $section );
322 - $oldLinks = $this->findLinks( $oldtext );
323 - $newLinks = $this->findLinks( $newtext );
 322+ $oldLinks = $this->findLinks( $editPage, $oldtext );
 323+ $newLinks = $this->findLinks( $editPage, $newtext );
324324 }
325325
326326 $unknownLinks = array_filter( $newLinks, array( &$this, 'filterLink' ) );
@@ -647,12 +647,12 @@
648648 * @param string $text
649649 * @return array of strings
650650 */
651 - function findLinks( $text ) {
652 - global $wgParser, $wgTitle, $wgUser;
 651+ function findLinks( &$editpage, $text ) {
 652+ global $wgParser, $wgUser;
653653
654654 $options = new ParserOptions();
655 - $text = $wgParser->preSaveTransform( $text, $wgTitle, $wgUser, $options );
656 - $out = $wgParser->parse( $text, $wgTitle, $options );
 655+ $text = $wgParser->preSaveTransform( $text, $editpage->mTitle, $wgUser, $options );
 656+ $out = $wgParser->parse( $text, $editpage->mTitle, $options );
657657
658658 return array_keys( $out->getExternalLinks() );
659659 }