From 6928864a0c522ad9959464991542f1cef6c892ea Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 19 Jun 2008 03:14:05 +0000 Subject: [PATCH] Hooks EditFilter and EditFilter complete got a new param (edit summary), docs updated with this. --- docs/hooks.txt | 2 ++ includes/EditPage.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 394938fa20..6916a779d8 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -523,11 +523,13 @@ $editor: Edit form (see includes/EditPage.php) $text: Contents of the edit box $section: Section being edited &$error: Error message to return +$summary: Edit summary for page 'EditFilterMerged': Post-section-merge edit filter $editor: EditPage instance (object) $text: content of the edit box $error: error message to return +$summary: Edit summary for page 'EditFormPreloadText': Allows population of the edit form when creating new pages &$text: Text to preload with diff --git a/includes/EditPage.php b/includes/EditPage.php index 0c428ec73f..1a9f4f752e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -749,13 +749,13 @@ class EditPage { wfProfileOut( $fname ); return self::AS_SPAM_ERROR; } - if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section ) ) { + if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) { # Error messages or other handling should be performed by the filter function wfProfileOut( "$fname-checks" ); wfProfileOut( $fname ); return self::AS_FILTERING; } - if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError ) ) ) { + if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) { # Error messages etc. could be handled within the hook... wfProfileOut( "$fname-checks" ); wfProfileOut( $fname ); @@ -833,7 +833,7 @@ class EditPage { } // Run post-section-merge edit filter - if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError ) ) ) { + if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; @@ -916,7 +916,7 @@ class EditPage { $oldtext = $this->mArticle->getContent(); // Run post-section-merge edit filter - if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError ) ) ) { + if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; -- 2.20.1