mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Parse SpamBlacklist error on the server-side
The client won't be able to deal with templates etc. Bug: T99830 Change-Id: I78611a3f061b1afd73de052aa9ddff48dc368f2d
This commit is contained in:
parent
31e45cf530
commit
82fb5f609a
|
@ -158,6 +158,13 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
'edit' => $saveresult['edit']
|
||||
);
|
||||
|
||||
if ( isset( $saveresult['edit']['spamblacklist'] ) ) {
|
||||
$matches = explode( '|', $saveresult['edit']['spamblacklist'] );
|
||||
$matcheslist = $this->getLanguage()->listToText( $matches );
|
||||
$result['edit']['sberrorparsed'] = $this->msg( 'spamprotectiontext' )->parse() . ' ' .
|
||||
$this->msg( 'spamprotectionmatch', $matcheslist )->parse();
|
||||
}
|
||||
|
||||
// Success
|
||||
} else {
|
||||
if ( isset( $saveresult['edit']['newrevid'] ) ) {
|
||||
|
|
|
@ -319,8 +319,6 @@
|
|||
"lastmodifiedat",
|
||||
"parentheses",
|
||||
"redirectpagesub",
|
||||
"spamprotectionmatch",
|
||||
"spamprotectiontext",
|
||||
"summary-preview",
|
||||
"fancycaptcha-reload-text",
|
||||
"visualeditor-loadwarning",
|
||||
|
|
|
@ -695,10 +695,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveErrorEmpty = function () {
|
|||
*/
|
||||
ve.init.mw.ViewPageTarget.prototype.onSaveErrorSpamBlacklist = function ( editApi ) {
|
||||
this.showSaveError(
|
||||
ve.msg( 'spamprotectiontext' ) + ' ' +
|
||||
ve.msg(
|
||||
'spamprotectionmatch', mw.language.listToText( editApi.spamblacklist.split( '|' ) )
|
||||
),
|
||||
$( $.parseHTML( editApi.sberrorparsed ) ),
|
||||
false // prevents reapply
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue