* Fixed bug #6821: Empty paragraph-tags with attributes are not editable in RTE
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 15 Jan 2008 22:37:54 +0000 (22:37 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 15 Jan 2008 22:37:54 +0000 (22:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2909 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_parsehtml_proc.php

index f16c534..f6b4004 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-14  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Fixed bug #6821: Empty paragraph-tags with attributes are not editable in RTE
+
 2008-01-15  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Added feature #6784: New login-box System-Extension "felogin". This is a refactored version of the "newloginbox" extension, now integrated into the core. (Big thanks to Steffen Kamper for writing this extension for core integration!)
index 9075918..5dc9667 100755 (executable)
@@ -1290,8 +1290,10 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                        // Add the processed line(s)
                                $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;' && !preg_match('/\<(img)(\s[^>]*)?\/?>/si', $divSplit[$k])) {
+                                       // If it turns out the line is just blank (containing a &nbsp; possibly) then just make it pure blank.
+                                       // But, prevent filtering of lines that are blank in sense above, but whose tags contain attributes.
+                                       // Those attributes should have been filtered before; if they are still there they must be considered as possible content.
+                               if (trim(strip_tags($divSplit[$k]))=='&nbsp;' && !preg_match('/\<(img)(\s[^>]*)?\/?>/si', $divSplit[$k]) && !preg_match('/\<([^>]*)?( align| class| style| id| title| dir| lang| xml:lang)([^>]*)?>/si', trim($divSplit[$k]))) {
                                        $divSplit[$k]='';
                                }
                        } else {        // outside div: