Clean up "bad parameter" error messages in Message handler
Change-Id: I64b54b1991d17ae97a8dd9414d6807daab982a3a
This commit is contained in:
parent
0eb07d1394
commit
2dd06563cd
1 changed files with 11 additions and 5 deletions
|
|
@ -1167,11 +1167,17 @@ class Message implements MessageSpecifier, Serializable {
|
|||
} elseif ( isset( $param['list'] ) ) {
|
||||
return $this->formatListParam( $param['list'], $param['type'], $format );
|
||||
} else {
|
||||
$warning = 'Invalid parameter for message "' . $this->getKey() . '": ' .
|
||||
htmlspecialchars( serialize( $param ) );
|
||||
trigger_error( $warning, E_USER_WARNING );
|
||||
$e = new Exception;
|
||||
wfDebugLog( 'Bug58676', $warning . "\n" . $e->getTraceAsString() );
|
||||
if ( !is_scalar( $param ) ) {
|
||||
$param = serialize( $param );
|
||||
}
|
||||
\MediaWiki\Logger\LoggerFactory::getInstance( 'Bug58676' )->warning(
|
||||
'Invalid parameter for message "{msgkey}": {param}',
|
||||
[
|
||||
'exception' => new Exception,
|
||||
'msgkey' => $this->getKey(),
|
||||
'param' => htmlspecialchars( $param ),
|
||||
]
|
||||
);
|
||||
|
||||
return [ 'before', '[INVALID]' ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue