From df6cde026cb7db28971e4fb380fbbe65d51ebb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 23 Nov 2015 10:57:02 +0100 Subject: [PATCH] Remove EditFilterMerged BC code This extension already requires 1.23+ Change-Id: Ie56d701c1663a280372caaf71560dfdca7500619 --- AbuseFilter.hooks.php | 27 --------------------------- AbuseFilter.php | 7 +------ 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index afa370f64..4758042f7 100755 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -59,33 +59,6 @@ class AbuseFilterHooks { return $status->isOK(); } - /** - * Entry points for MediaWiki hook 'EditFilterMerged' (MW 1.20 and earlier) - * - * @param $editor EditPage instance (object) - * @param $text string Content of the edit box - * @param &$error string Error message to return - * @param $summary string Edit summary for page - * @return bool - */ - public static function onEditFilterMerged( $editor, $text, &$error, $summary ) { - $context = $editor->mArticle->getContext(); - - $status = Status::newGood(); - $minoredit = $editor->minoredit; - - // poor man's PST, see bug 20310 - $text = str_replace( "\r\n", "\n", $text ); - - $continue = self::filterEdit( $context, null, $text, $status, $summary, $minoredit ); - - if ( !$status->isOK() ) { - $error = $status->getWikiText(); - } - - return $continue; - } - /** * Entry points for MediaWiki hook 'EditFilterMergedContent' (MW 1.21 and later) * diff --git a/AbuseFilter.php b/AbuseFilter.php index 33f5c0dc2..0f79fe18a 100644 --- a/AbuseFilter.php +++ b/AbuseFilter.php @@ -79,12 +79,7 @@ $wgAutoloadClasses['ApiAbuseFilterCheckMatch'] = "$dir/api/ApiAbuseFilterCheckMa $wgAPIModules['abusefiltercheckmatch'] = 'ApiAbuseFilterCheckMatch'; -if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) { - $wgHooks['EditFilterMergedContent'][] = 'AbuseFilterHooks::onEditFilterMergedContent'; -} else { - $wgHooks['EditFilterMerged'][] = 'AbuseFilterHooks::onEditFilterMerged'; -} - +$wgHooks['EditFilterMergedContent'][] = 'AbuseFilterHooks::onEditFilterMergedContent'; $wgHooks['GetAutoPromoteGroups'][] = 'AbuseFilterHooks::onGetAutoPromoteGroups'; $wgHooks['AbortMove'][] = 'AbuseFilterHooks::onAbortMove'; $wgHooks['MovePageCheckPermissions'][] = 'AbuseFilterHooks::onMovePageCheckPermissions';