BUGFIX Avoid ajax evaluator errors by checking if $resizedImage actually exists before calling relativePath() on it

MINOR Code formatting cleanup



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64850 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-10-28 23:20:14 +00:00
parent 2c4edddd1b
commit 68326a5eac

View File

@ -235,8 +235,8 @@ function HtmlEditorField_dataValue_processImage($parts) {
// 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 we have an image, generate the resized image.
$resizedImage = $image->getFormattedImage("ResizedImage",$width, $height);
$parts[$partSource['src="']] = $resizedImage->getRelativePath() ;
$resizedImage = $image->getFormattedImage('ResizedImage', $width, $height);
if($resizedImage) $parts[$partSource['src="']] = $resizedImage->getRelativePath();
}
$parts[0] = "";