Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
Utils | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
getErrorHtml | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\RSS; |
4 | |
5 | use MediaWiki\Html\Html; |
6 | |
7 | class Utils { |
8 | |
9 | /** |
10 | * Output an error message, all wrapped up nicely in HTML. |
11 | * @param string $errorMessageName The system message that this error is |
12 | * @param string[]|string|null $params Error parameter (or parameters). |
13 | * @return string HTML that is the error. |
14 | */ |
15 | public static function getErrorHtml( $errorMessageName, $params = null ) { |
16 | // Anything from a parser tag should use Content lang for message, |
17 | // since the cache doesn't vary by user language: use ->inContentLanguage() |
18 | // The ->parse() part makes everything safe from an escaping standpoint. |
19 | |
20 | return Html::rawElement( 'span', [ 'class' => 'error' ], |
21 | "Extension:RSS -- Error: " . wfMessage( $errorMessageName ) |
22 | ->inContentLanguage()->params( $params )->parse() |
23 | ); |
24 | } |
25 | |
26 | } |