Fixed EditFilterMerged hook to use hookError param
authorNephele <nephele@users.mediawiki.org>
Sun, 30 Aug 2009 05:55:47 +0000 (05:55 +0000)
committerNephele <nephele@users.mediawiki.org>
Sun, 30 Aug 2009 05:55:47 +0000 (05:55 +0000)
RELEASE-NOTES
includes/EditPage.php

index 019ffe6..ce5d347 100644 (file)
@@ -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 ==
 
index d66f0c3..42c74c9 100644 (file)
@@ -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