mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX for #7606: Ensure the object we're handling is actually an Image instance before calling methods specific to that class (e.g. in case of using SVG's in <img> tag which may be File instances).
This commit is contained in:
parent
ef86b16854
commit
52f0eadd3b
@ -87,7 +87,8 @@ class HtmlEditorField extends TextareaField {
|
||||
$img->setAttribute('src', preg_replace('/([^\?]*)\?r=[0-9]+$/i', '$1', $img->getAttribute('src')));
|
||||
|
||||
// Resample the images if the width & height have changed.
|
||||
if($image = File::find(urldecode(Director::makeRelative($img->getAttribute('src'))))){
|
||||
$image = File::find(urldecode(Director::makeRelative($img->getAttribute('src'))));
|
||||
if($image instanceof Image){
|
||||
$width = (int)$img->getAttribute('width');
|
||||
$height = (int)$img->getAttribute('height');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user