* Fix bugtracker issue 3051: RTE removes images under special conditions when saving
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 13 Apr 2006 15:46:36 +0000 (15:46 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 13 Apr 2006 15:46:36 +0000 (15:46 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1432 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_parsehtml_proc.php

index e71e1f9..d5f4876 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2006-04-13  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fix bugtracker issue 3172: re-write getMimeType in t3lib_htmlmail
+       * Fix bugtracker issue 3051: RTE removes images under special conditions when saving
 
 2006-04-12  Ingmar Schlecht <ingmar@typo3.org>
 
index d1f9f3b..c3663af 100755 (executable)
@@ -1280,7 +1280,9 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                $divSplit[$k] = implode(chr(10),$subLines);
 
                                        // If it turns out the line is just blank (containing a &nbsp; possibly) then just make it pure blank:
-                               if (trim(strip_tags($divSplit[$k]))=='&nbsp;')          $divSplit[$k]='';
+                               if (trim(strip_tags($divSplit[$k]))=='&nbsp;' && !preg_match('/\<(img)(\s[^>]*)?\/?>/si', $divSplit[$k])) {
+                                       $divSplit[$k]='';
+                               }
                        } else {        // outside div:
                                        // Remove positions which are outside div/p tags and without content
                                $divSplit[$k]=trim(strip_tags($divSplit[$k],'<'.implode('><',$allowTagsOutside).'>'));