mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixes a translation issue where a parameter isn't replaced.
Whenever File::Validate() failed due to an illegal file extension, it printed the translated message without replacing the parameter {extensions}.
This commit is contained in:
parent
5ff69b98ab
commit
6ce2a90f19
@ -875,14 +875,11 @@ class File extends DataObject {
|
||||
if(!in_array(strtolower($extension), $allowed)) {
|
||||
$exts = $allowed;
|
||||
sort($exts);
|
||||
$message = sprintf(
|
||||
_t(
|
||||
$message = _t(
|
||||
'File.INVALIDEXTENSION',
|
||||
'Extension is not allowed (valid: %s)',
|
||||
|
||||
'Argument 1: Comma-separated list of valid extensions'
|
||||
),
|
||||
wordwrap(implode(', ',$exts))
|
||||
'Extension is not allowed (valid: {extensions})',
|
||||
'Argument 1: Comma-separated list of valid extensions',
|
||||
array('extensions' => wordwrap(implode(', ',$exts)))
|
||||
);
|
||||
return new ValidationResult(false, $message);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user