FIX TinyMCEConfig image size presets handle incorrect values

This commit is contained in:
Serge Latyntcev 2020-10-12 16:54:29 +13:00
parent ce3e642b12
commit 034bace213
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,7 @@ SilverStripe\Core\Injector\Injector:
SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
image_size_presets:
- width: 600,
- width: 600
i18n: SilverStripe\Forms\HTMLEditor\TinyMCEConfig.BEST_FIT
text: Best fit
name: bestfit

View File

@ -694,6 +694,10 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
}
foreach ($settings['image_size_presets'] as &$preset) {
if (isset($preset['width'])) {
$preset['width'] = (int) $preset['width'];
}
if (isset($preset['i18n'])) {
$preset['text'] = _t(
$preset['i18n'],