From: Chad Horohoe Date: Thu, 19 Jun 2008 03:14:05 +0000 (+0000) Subject: Hooks EditFilter and EditFilter complete got a new param (edit summary), docs updated... X-Git-Tag: 1.31.0-rc.0~46957 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=6928864a0c522ad9959464991542f1cef6c892ea;p=lhc%2Fweb%2Fwiklou.git Hooks EditFilter and EditFilter complete got a new param (edit summary), docs updated with this. --- 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;