mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-27 17:20:01 +00:00
Merge "Fix use of formatnum in templatedata-invalid-length"
This commit is contained in:
commit
4b3a7fa4e3
|
@ -50,7 +50,7 @@
|
|||
"templatedata-invalid-duplicate-value": "Property \"$1\" (\"$3\") is a duplicate of \"$2\".",
|
||||
"templatedata-invalid-empty-array": "Property \"$1\" must have at least one value in its array.",
|
||||
"templatedata-invalid-format": "Property \"$1\" is expected to be \"inline\", \"block\", or a valid format string.",
|
||||
"templatedata-invalid-length": "Data too large to save ({{formatnum:$1}} {{PLURAL:$1|byte|bytes}}, {{PLURAL:$2|limit is}} {{formatnum:$2}})",
|
||||
"templatedata-invalid-length": "Data too large to save ($1 {{PLURAL:$1|byte|bytes}}, {{PLURAL:$2|limit is}} $2)",
|
||||
"templatedata-invalid-missing": "Required property \"$1\" not found.",
|
||||
"templatedata-invalid-param": "Invalid parameter \"$1\" for property \"$2\".",
|
||||
"templatedata-invalid-parse": "Syntax error in JSON.",
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
namespace MediaWiki\Extension\TemplateData;
|
||||
|
||||
use Message;
|
||||
use Status;
|
||||
|
||||
/**
|
||||
|
@ -32,7 +33,11 @@ class TemplateDataCompressedBlob extends TemplateDataBlob {
|
|||
if ( $status->isOK() ) {
|
||||
$length = strlen( $this->getJSONForDatabase() );
|
||||
if ( $length > self::MAX_LENGTH ) {
|
||||
return Status::newFatal( 'templatedata-invalid-length', $length, self::MAX_LENGTH );
|
||||
return Status::newFatal(
|
||||
'templatedata-invalid-length',
|
||||
Message::numParam( $length ),
|
||||
Message::numParam( self::MAX_LENGTH )
|
||||
);
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
|
|
Loading…
Reference in a new issue