jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/328428 )
Change subject: Replaced deprecated hooks ...................................................................... Replaced deprecated hooks Bug: T151973 Change-Id: I30dbcedf54bf4cfb4602ed129353e93304f935f7 --- M available/GenericFormEncoding.php M available/XRumerCommentBug.php M available/XRumerCookieBug.php 3 files changed, 26 insertions(+), 15 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/available/GenericFormEncoding.php b/available/GenericFormEncoding.php index 862cda6..a059aad 100644 --- a/available/GenericFormEncoding.php +++ b/available/GenericFormEncoding.php @@ -8,21 +8,21 @@ * attribute. */ -$wgHooks['EditFilterMerged'][] = 'AntiBot_GenericFormEncoding::onEditFilterMerged'; +$wgHooks['EditFilterMergedContent'][] = 'AntiBot_GenericFormEncoding::onEditFilterMergedContent'; class AntiBot_GenericFormEncoding { /** - * @param $editPage EditPage - * @param $text string - * @param $hookError + * @param $context IContextSource + * @param $content Content + * @param $status Status + * @param $summary string + * @param $user User * @return bool */ - public static function onEditFilterMerged( $editPage, $text, &$hookError ) { - global $wgUser; + public static function onEditFilterMergedContent( $context, $content, $status, $summary, $user ) { + $header = $context->getRequest()->getHeader( 'Content-Type' ); - $header = $editPage->getArticle()->getContext()->getRequest()->getHeader( 'Content-Type' ); - - if ( $header === 'application/x-www-form-urlencoded' && !$wgUser->isAllowed( 'bot' ) + if ( $header === 'application/x-www-form-urlencoded' && !$user->isAllowed( 'bot' ) && AntiBot::trigger( __CLASS__ ) == 'fail' ) { return false; } diff --git a/available/XRumerCommentBug.php b/available/XRumerCommentBug.php index adb667e..2baff1e 100644 --- a/available/XRumerCommentBug.php +++ b/available/XRumerCommentBug.php @@ -5,7 +5,7 @@ */ $wgHooks['EditPage::showEditForm:fields'][] = 'AntiBot_XRumerCommentBug::onEditFormFields'; -$wgHooks['EditFilterMerged'][] = 'AntiBot_XRumerCommentBug::onEditFilterMerged'; +$wgHooks['EditFilterMergedContent'][] = 'AntiBot_XRumerCommentBug::onEditFilterMergedContent'; class AntiBot_XRumerCommentBug { function onEditFormFields( &$editPage, &$wgOut ) { @@ -14,9 +14,14 @@ return true; } - function onEditFilterMerged( $editPage, $text, &$hookError ) { - global $wgRequest; - if ( $wgRequest->getVal( AntiBot::getSecret( 'CommentBug' ) ) !== null ){ + /** + * @param $context IContextSource + * @param $content Content + * @param $status Status + * @return bool + */ + function onEditFilterMergedContent( $context, $content, $status ) { + if ( $context->getRequest()->getVal( AntiBot::getSecret( 'CommentBug' ) ) !== null ){ if ( AntiBot::trigger(__CLASS__) == 'fail' ) { return false; } diff --git a/available/XRumerCookieBug.php b/available/XRumerCookieBug.php index 3adeea2..7f08f44 100644 --- a/available/XRumerCookieBug.php +++ b/available/XRumerCookieBug.php @@ -7,7 +7,7 @@ */ $wgHooks['EditPage::showEditForm:initial'][] = 'AntiBot_XRumerCookieBug::onEditForm'; -$wgHooks['EditFilterMerged'][] = 'AntiBot_XRumerCookieBug::onEditFilterMerged'; +$wgHooks['EditFilterMergedContent'][] = 'AntiBot_XRumerCookieBug::onEditFilterMergedContent'; class AntiBot_XRumerCookieBug { function onEditForm( &$editPage ) { @@ -18,7 +18,13 @@ return true; } - function onEditFilterMerged( $editPage, $text, &$hookError ) { + /** + * @param $context IContextSource + * @param $content Content + * @param $status Status + * @return bool + */ + function onEditFilterMergedContent( $context, $content, $status ) { if ( isset( $_COOKIE[AntiBot::getSecret( 'CookieBug2' ) ] ) ) { if ( AntiBot::trigger(__CLASS__) == 'fail' ) { return false; -- To view, visit https://gerrit.wikimedia.org/r/328428 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30dbcedf54bf4cfb4602ed129353e93304f935f7 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/AntiBot Gerrit-Branch: master Gerrit-Owner: Georggi199 <bmp2...@gmail.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits