Skip to content

Commit

Permalink
MINOR: fixed html image saving problem on HtmlEditorField
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@75173 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
mandrew authored and Sam Minnee committed Feb 2, 2011
1 parent 13547d8 commit e798007
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions forms/HtmlEditorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ 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) {
if($image && $image->getWidth() != $width && $image->getHeight() != $height) {
// If we have an image, generate the resized image.
$resizedImage = $image->getFormattedImage("ResizedImage",$width, $height);
$parts[$partSource['src="']] = $resizedImage->getRelativePath() ;
if($resizedImage) $parts[$partSource['src="']] = $resizedImage->getRelativePath();
}

$parts[0] = "";
Expand Down

0 comments on commit e798007

Please sign in to comment.