diff --git a/_config/html.yml b/_config/html.yml index dff94addb..83b30d3db 100644 --- a/_config/html.yml +++ b/_config/html.yml @@ -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 diff --git a/src/Forms/HTMLEditor/TinyMCEConfig.php b/src/Forms/HTMLEditor/TinyMCEConfig.php index e7f356fa6..f4bc99dbc 100644 --- a/src/Forms/HTMLEditor/TinyMCEConfig.php +++ b/src/Forms/HTMLEditor/TinyMCEConfig.php @@ -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'],