mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 00:05:00 +00:00
Don't depend on Message implementation details
You're not really supposed to know how Message represents the parameters internally. Change-Id: I5767dcc96af77b21655609cb9ce43bcaf9e07e19
This commit is contained in:
parent
b4a7d5c8ca
commit
ce1fa91c54
|
@ -51,7 +51,16 @@ class MessageLibrary extends LibraryBase {
|
||||||
}
|
}
|
||||||
$msg->useDatabase( $data['useDB'] );
|
$msg->useDatabase( $data['useDB'] );
|
||||||
if ( $setParams ) {
|
if ( $setParams ) {
|
||||||
$msg->params( array_values( $data['params'] ) );
|
foreach ( $data['params'] as $param ) {
|
||||||
|
// Only rawParam and numParam are supposed by the Lua message API
|
||||||
|
if ( is_array( $param ) && isset( $param['raw'] ) ) {
|
||||||
|
$msg->rawParams( $param );
|
||||||
|
} elseif ( is_array( $param ) && isset( $param['num'] ) ) {
|
||||||
|
$msg->numParams( $param );
|
||||||
|
} else {
|
||||||
|
$msg->params( $param );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue