Georggi199 has uploaded a new change for review. ( 
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, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiBot 
refs/changes/28/328428/1

diff --git a/available/GenericFormEncoding.php 
b/available/GenericFormEncoding.php
index 862cda6..b5db5b4 100644
--- a/available/GenericFormEncoding.php
+++ b/available/GenericFormEncoding.php
@@ -8,19 +8,19 @@
  * 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
         * @return bool
         */
-       public static function onEditFilterMerged( $editPage, $text, 
&$hookError ) {
+       public static function onEditFilterMergedContent( $context, $content, 
$status ) {
                global $wgUser;
 
-               $header = 
$editPage->getArticle()->getContext()->getRequest()->getHeader( 'Content-Type' 
);
+               $header = $context->getRequest()->getHeader( 'Content-Type' );
 
                if ( $header === 'application/x-www-form-urlencoded' && 
!$wgUser->isAllowed( 'bot' )
                        && AntiBot::trigger( __CLASS__ ) == 'fail' ) {
diff --git a/available/XRumerCommentBug.php b/available/XRumerCommentBug.php
index adb667e..d08855d 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,7 +14,7 @@
                return true;
        }
 
-       function onEditFilterMerged( $editPage, $text, &$hookError ) {
+       function onEditFilterMergedContent( $context, $content, $status ) {
                global $wgRequest;
                if ( $wgRequest->getVal( AntiBot::getSecret( 'CommentBug' ) ) 
!== null ){
                        if ( AntiBot::trigger(__CLASS__) == 'fail' ) {
diff --git a/available/XRumerCookieBug.php b/available/XRumerCookieBug.php
index 3adeea2..a048d7a 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,7 @@
                return true;
        }
 
-       function onEditFilterMerged( $editPage, $text, &$hookError ) {
+       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: newchange
Gerrit-Change-Id: I30dbcedf54bf4cfb4602ed129353e93304f935f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiBot
Gerrit-Branch: master
Gerrit-Owner: Georggi199 <bmp2...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to