* Bug #2547: Properties of images are not saved due to RTE transformation
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 26 Jan 2008 15:31:36 +0000 (15:31 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 26 Jan 2008 15:31:36 +0000 (15:31 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2969 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_parsehtml_proc.php

index 459ed3c..74c179d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-26  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Bug #2547: Properties of images are not saved due to RTE transformation
+
 2008-01-26  Ingo Renner  <ingo@typo3.org>
 
        * fixed bug #7222: When installing an extension that contains a new backend module the module menu is not refreshed anymore when using backend.php
index 5dc9667..ae25fce 100755 (executable)
@@ -474,10 +474,10 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                                                        if ($imgI[3])   {
                                                                                $fI=pathinfo($imgI[3]);
                                                                                @copy($imgI[3],$filepath);      // Override the child file
-                                                                               unset($attribArray['style']);
+                                                                                       // Removing width and heigth form style attribute
+                                                                               $attribArray['style'] = preg_replace('/((?:^|)\s*(?:width|height)\s*:[^;]*(?:$|;))/si', '', $attribArray['style']);
                                                                                $attribArray['width']=$imgI[0];
                                                                                $attribArray['height']=$imgI[1];
-                                                                               if (!$attribArray['border'])    $attribArray['border']=0;
                                                                                $params = t3lib_div::implodeAttributes($attribArray,1);
                                                                                $imgSplit[$k]='<img '.$params.' />';
                                                                        }
@@ -486,15 +486,14 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
 
                                                } elseif ($this->procOptions['plainImageMode']) {       // If "plain image" has been configured:
 
-                                                               // Image dimensions as set in the image tag
+                                                               // Image dimensions as set in the image tag, if any
                                                        $curWH = $this->getWHFromAttribs($attribArray);
-                                                       $attribArray['width'] = $curWH[0];
-                                                       $attribArray['height'] = $curWH[1];
-
-                                                               // Forcing values for style and border:
-                                                       unset($attribArray['style']);
-                                                       if (!$attribArray['border'])    $attribArray['border'] = 0;
+                                                       if ($curWH[0]) $attribArray['width'] = $curWH[0];
+                                                       if ($curWH[1]) $attribArray['height'] = $curWH[1];
 
+                                                               // Removing width and heigth form style attribute
+                                                       $attribArray['style'] = preg_replace('/((?:^|)\s*(?:width|height)\s*:[^;]*(?:$|;))/si', '', $attribArray['style']);
+                                                       
                                                                // Finding dimensions of image file:
                                                        $fI = @getimagesize($filepath);