* (bug 5839) Prevent access to Special:Confirmemail for logged-out users
* (bug 5853) Update for Portuguese messages (pt)
* (bug 5851) Use Cyrillic for Kirghiz language name
-
+* (bug 5841) Allow the 'EditFilter' hook to return a non-fatal error message
== Compatibility ==
$block: the Block object that was saved
$user: the user who did the block (not the one being blocked)
+'EditFilter': Perform checks on an edit
+$editor: Edit form (see includes/EditPage.php)
+$text: Contents of the edit box
+§ion: Section being edited
+$error: Error message to return
+
+Return false to halt editing; you'll need to handle error messages, etc. yourself.
+Alternatively, modifying $error and returning true will cause the contents of $error
+to be echoed at the top of the edit form as wikitext. Return true without altering
+$error to allow the edit to proceed.
+
'EmailConfirmed': When checking that the user's email address is "confirmed"
$user: User being checked
$confirmed: Whether or not the email address is confirmed
var $missingSummary = false;
var $allowBlankSummary = false;
var $autoSumm = '';
+ var $hookError = '';
# Form values
var $save = false, $preview = false, $diff = false;
wfProfileOut( "$fname-checks" );
return false;
}
- if ( !wfRunHooks( 'EditFilter', array( &$this, $this->textbox1, $this->section ) ) ) {
- # Error messages or other handling should be performed by the filter function
+ if ( !wfRunHooks( 'EditFilter', array( &$this, $this->textbox1, $this->section, &$this->hookError ) ) ) {
+ # Error messages etc. could be handled within the hook...
wfProfileOut( $fname );
wfProfileOut( "$fname-checks" );
return false;
+ } elseif( $this->hookError != '' ) {
+ # ...or the hook could be expecting us to produce an error
+ wfProfileOut( "$fname-checks " );
+ wfProfileOut( $fname );
+ return false;
}
if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
# Check block state against master, thus 'false'.
if( $this->missingSummary ) {
$wgOut->addWikiText( wfMsg( 'missingsummary' ) );
}
+
+ if( !$this->hookError = '' ) {
+ $wgOut->addWikiText( $this->hookError );
+ }
if ( !$this->checkUnicodeCompliantBrowser() ) {
$wgOut->addWikiText( wfMsg( 'nonunicodebrowser') );