From 5c75cef4253adef75f3d51697005905640fabbb2 Mon Sep 17 00:00:00 2001 From: Nephele Date: Sun, 30 Aug 2009 05:55:47 +0000 Subject: [PATCH] Fixed EditFilterMerged hook to use hookError param --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 019ffe67ff..ce5d34731c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -441,6 +441,8 @@ this. Was used when mwEmbed was going to be an extension. * (bug 20260) SQLite no longer tries to automatically create the database at execution time, this now happens only at install time; if it is not available at script execution, it now throws an exception +* Fixed EditFilterMerged hook so the hookError parameter serves a purpose + (analogous to EditFilter hook) == API changes in 1.16 == diff --git a/includes/EditPage.php b/includes/EditPage.php index d66f0c3ff4..42c74c905d 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -890,6 +890,10 @@ class EditPage { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; + } elseif ( $this->hookError != '' ) { + # ...or the hook could be expecting us to produce an error + wfProfileOut( $fname ); + return self::AS_HOOK_ERROR_EXPECTED; } # Handle the user preference to force summaries here. Check if it's not a redirect. @@ -978,6 +982,10 @@ class EditPage { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; + } elseif ( $this->hookError != '' ) { + # ...or the hook could be expecting us to produce an error + wfProfileOut( $fname ); + return self::AS_HOOK_ERROR_EXPECTED; } # Handle the user preference to force summaries here, but not for null edits -- 2.20.1