mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811 Change-Id: I6147fc4aa6d004cd848c170750a740091c336012
This commit is contained in:
parent
edcc3ba75e
commit
d0d036ea50
|
@ -1087,8 +1087,6 @@ class SimpleCaptcha {
|
|||
* @private
|
||||
*/
|
||||
private function loadText( $title, $section, $flags = Revision::READ_LATEST ) {
|
||||
global $wgParser;
|
||||
|
||||
$rev = Revision::newFromTitle( $title, false, $flags );
|
||||
if ( is_null( $rev ) ) {
|
||||
return "";
|
||||
|
@ -1097,7 +1095,8 @@ class SimpleCaptcha {
|
|||
$content = $rev->getContent();
|
||||
$text = ContentHandler::getContentText( $content );
|
||||
if ( $section !== '' ) {
|
||||
return $wgParser->getSection( $text, $section );
|
||||
return MediaWikiServices::getInstance()->getParser()
|
||||
->getSection( $text, $section );
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
@ -1110,11 +1109,12 @@ class SimpleCaptcha {
|
|||
* @return array of strings
|
||||
*/
|
||||
private function findLinks( $title, $text ) {
|
||||
global $wgParser, $wgUser;
|
||||
global $wgUser;
|
||||
|
||||
$parser = MediaWikiServices::getInstance()->getParser();
|
||||
$options = new ParserOptions();
|
||||
$text = $wgParser->preSaveTransform( $text, $title, $wgUser, $options );
|
||||
$out = $wgParser->parse( $text, $title, $options );
|
||||
$text = $parser->preSaveTransform( $text, $title, $wgUser, $options );
|
||||
$out = $parser->parse( $text, $title, $options );
|
||||
|
||||
return array_keys( $out->getExternalLinks() );
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "antispam",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.31.0"
|
||||
"MediaWiki": ">= 1.32.0"
|
||||
},
|
||||
"GroupPermissions": {
|
||||
"*": {
|
||||
|
|
Loading…
Reference in a new issue