mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-12-02 19:36:09 +00:00
a7c9a664b8
Done automatically via script Change-Id: I960cc93c19639202cdb63c5b0b00bfc468abb37e
27 lines
830 B
PHP
27 lines
830 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\RSS;
|
|
|
|
use MediaWiki\Html\Html;
|
|
|
|
class Utils {
|
|
|
|
/**
|
|
* Output an error message, all wrapped up nicely in HTML.
|
|
* @param string $errorMessageName The system message that this error is
|
|
* @param string[]|string|null $params Error parameter (or parameters).
|
|
* @return string HTML that is the error.
|
|
*/
|
|
public static function getErrorHtml( $errorMessageName, $params = null ) {
|
|
// Anything from a parser tag should use Content lang for message,
|
|
// since the cache doesn't vary by user language: use ->inContentLanguage()
|
|
// The ->parse() part makes everything safe from an escaping standpoint.
|
|
|
|
return Html::rawElement( 'span', [ 'class' => 'error' ],
|
|
"Extension:RSS -- Error: " . wfMessage( $errorMessageName )
|
|
->inContentLanguage()->params( $params )->parse()
|
|
);
|
|
}
|
|
|
|
}
|