MINOR: fixed html image saving problem on HtmlEditorField

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@75173 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Michael Andrewartha 2009-04-27 03:06:39 +00:00 committed by Sam Minnee
parent 13547d82a1
commit e798007f0a

View File

@ -239,10 +239,10 @@ function HtmlEditorField_dataValue_processImage($parts) {
$image = Image::find(urldecode($src)); $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 we have an image, insert the resampled one into the src attribute; otherwise, leave the img src alone.
if($image) { if($image && $image->getWidth() != $width && $image->getHeight() != $height) {
// If we have an image, generate the resized image. // If we have an image, generate the resized image.
$resizedImage = $image->getFormattedImage("ResizedImage",$width, $height); $resizedImage = $image->getFormattedImage("ResizedImage",$width, $height);
$parts[$partSource['src="']] = $resizedImage->getRelativePath() ; if($resizedImage) $parts[$partSource['src="']] = $resizedImage->getRelativePath();
} }
$parts[0] = ""; $parts[0] = "";