Fixed bug #14748: Span tags with multiple classes being removed by RTE transformation
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 17 Jun 2010 03:05:27 +0000 (03:05 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 17 Jun 2010 03:05:27 +0000 (03:05 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7945 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_parsehtml.php

index b0fea00..b199335 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
 
        * Fixed bug #14567: htmlArea RTE: RTE is greyed out and has no "styles" in page module QuickEdit
        * Fixed bug #14746: htmlArea RTE: TableOperations: Label for "Headers" has a colon in excess
+       * Fixed bug #14748: Span tags with multiple classes being removed by RTE transformation
 
 2010-06-16  Steffen Kamper  <info@sk-typo3.de>
 
index c7f1215..a0e5f7e 100644 (file)
@@ -810,8 +810,27 @@ class t3lib_parsehtml      {
                                                                                                        $tagAttrib[0][$attr]=t3lib_div::intInRange($tagAttrib[0][$attr],intval($params['range'][0]));
                                                                                                }
                                                                                        }
-                                                                                       if (is_array($params['list']))  {
-                                                                                               if (!in_array($this->caseShift($tagAttrib[0][$attr],$params['casesensitiveComp']),$this->caseShift($params['list'],$params['casesensitiveComp'],$tagName)))     $tagAttrib[0][$attr]=$params['list'][0];
+                                                                                       if (is_array($params['list'])) {
+                                                                                                       // For the class attribute, remove from the attribute value any class not in the list
+                                                                                                       // Classes are case sensitive
+                                                                                               if ($attr == 'class') {
+                                                                                                       $newClasses = array();
+                                                                                                       $classes = t3lib_div::trimExplode(' ', $tagAttrib[0][$attr], TRUE);
+                                                                                                       foreach ($classes as $class) {
+                                                                                                               if (in_array($class, $params['list'])) {
+                                                                                                                       $newClasses[] = $class;
+                                                                                                               }
+                                                                                                       }
+                                                                                                       if (count($newClasses)) {
+                                                                                                               $tagAttrib[0][$attr] = implode(' ', $newClasses);
+                                                                                                       } else {
+                                                                                                               $tagAttrib[0][$attr] = '';
+                                                                                                       }
+                                                                                               } else {
+                                                                                                       if (!in_array($this->caseShift($tagAttrib[0][$attr],$params['casesensitiveComp']),$this->caseShift($params['list'],$params['casesensitiveComp'],$tagName))) {
+                                                                                                               $tagAttrib[0][$attr]=$params['list'][0];
+                                                                                                       }
+                                                                                               }
                                                                                        }
                                                                                        if (($params['removeIfFalse'] && $params['removeIfFalse']!='blank' && !$tagAttrib[0][$attr]) || ($params['removeIfFalse']=='blank' && !strcmp($tagAttrib[0][$attr],'')))        {
                                                                                                unset($tagAttrib[0][$attr]);