mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Ensure that the return object of File::find() is an instance of Image in HtmlEditorField_readonly::HtmlEditorField_dataValue_processImage()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76374 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2f61a5a84f
commit
66fe1a1838
@ -234,7 +234,7 @@ function HtmlEditorField_dataValue_processImage($parts) {
|
||||
$image = Image::find(urldecode($src));
|
||||
|
||||
// If we have an image, insert the resampled one into the src attribute; otherwise, leave the img src alone.
|
||||
if($image && $image->getWidth() != $width && $image->getHeight() != $height) {
|
||||
if($image && ($image instanceof Image) && ($image->getWidth() != $width) && ($image->getHeight() != $height)) {
|
||||
// If we have an image, generate the resized image.
|
||||
$resizedImage = $image->getFormattedImage('ResizedImage', $width, $height);
|
||||
if($resizedImage) $parts[$partSource['src="']] = $resizedImage->getRelativePath();
|
||||
|
Loading…
Reference in New Issue
Block a user