X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiErrorFormatter.php;h=9669464733d51bc2f83a8105ec6ae150843e75b5;hb=9b98959aedcafe01906a259cf926fa88d203a166;hp=a37ecc2df993dfe6c22c1977577538446bf34b07;hpb=307c95dbcdf6cfce7fc2ee4035724ac82eb49c5e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiErrorFormatter.php b/includes/api/ApiErrorFormatter.php index a37ecc2df9..9669464733 100644 --- a/includes/api/ApiErrorFormatter.php +++ b/includes/api/ApiErrorFormatter.php @@ -153,9 +153,10 @@ class ApiErrorFormatter { * @param string|null $modulePath * @param StatusValue $status * @param string[]|string $types 'warning' and/or 'error' + * @param string[] $filter Messages to filter out (since 1.33) */ public function addMessagesFromStatus( - $modulePath, StatusValue $status, $types = [ 'warning', 'error' ] + $modulePath, StatusValue $status, $types = [ 'warning', 'error' ], array $filter = [] ) { if ( $status->isGood() || !$status->getErrors() ) { return; @@ -178,7 +179,9 @@ class ApiErrorFormatter { ->inLanguage( $this->lang ) ->title( $this->getDummyTitle() ) ->useDatabase( $this->useDB ); - $this->addWarningOrError( $tag, $modulePath, $msg ); + if ( !in_array( $msg->getKey(), $filter, true ) ) { + $this->addWarningOrError( $tag, $modulePath, $msg ); + } } }