mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Merge "Fix variable descriptions showing raw "($1)""
This commit is contained in:
commit
8dd15bac76
|
@ -56,12 +56,15 @@ class VariablesFormatter {
|
|||
|
||||
$varMsgKey = $this->keywordsManager->getMessageKeyForVar( $key );
|
||||
if ( $varMsgKey ) {
|
||||
$keyDisplay = $this->messageLocalizer->msg( $varMsgKey )->parse() . ' ' .
|
||||
Html::element(
|
||||
'code',
|
||||
[],
|
||||
$this->messageLocalizer->msg( 'parentheses' )->rawParams( $key )->text()
|
||||
);
|
||||
$varMsg = $this->messageLocalizer->msg( $varMsgKey );
|
||||
$arg = Html::element( 'code', [], $key );
|
||||
if ( str_contains( $varMsg->plain(), '$1' ) ) {
|
||||
$keyDisplay = $varMsg->params( $arg )->parse();
|
||||
} else {
|
||||
// workaround due to 1904cf8 (temporary?)
|
||||
$keyDisplay = $varMsg->parse() . ' '
|
||||
. $this->messageLocalizer->msg( 'parentheses' )->rawParams( $arg )->escaped();
|
||||
}
|
||||
} else {
|
||||
$keyDisplay = Html::element( 'code', [], $key );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue