From: Roan Kattouw Date: Fri, 5 Sep 2008 14:57:42 +0000 (+0000) Subject: ConfirmEdit: Fix use of $wgTitle, should fix bug 15420 X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/commitdiff_plain/0aba2a27838fa9a3de9bf9d5ef376a335d769333 ConfirmEdit: Fix use of $wgTitle, should fix bug 15420 --- diff --git a/ConfirmEdit_body.php b/ConfirmEdit_body.php index 9e451ab..99c7a72 100644 --- a/ConfirmEdit_body.php +++ b/ConfirmEdit_body.php @@ -318,8 +318,8 @@ class SimpleCaptcha { } else { // Get link changes in the slowest way known to man $oldtext = $this->loadText( $editPage, $section ); - $oldLinks = $this->findLinks( $oldtext ); - $newLinks = $this->findLinks( $newtext ); + $oldLinks = $this->findLinks( $editPage, $oldtext ); + $newLinks = $this->findLinks( $editPage, $newtext ); } $unknownLinks = array_filter( $newLinks, array( &$this, 'filterLink' ) ); @@ -647,12 +647,12 @@ class SimpleCaptcha { * @param string $text * @return array of strings */ - function findLinks( $text ) { - global $wgParser, $wgTitle, $wgUser; + function findLinks( &$editpage, $text ) { + global $wgParser, $wgUser; $options = new ParserOptions(); - $text = $wgParser->preSaveTransform( $text, $wgTitle, $wgUser, $options ); - $out = $wgParser->parse( $text, $wgTitle, $options ); + $text = $wgParser->preSaveTransform( $text, $editpage->mTitle, $wgUser, $options ); + $out = $wgParser->parse( $text, $editpage->mTitle, $options ); return array_keys( $out->getExternalLinks() ); }