Issue Bug Closed

#21485Multiple assigned classes in Text Style get lost in HTML cleaner.

Schmidt Timo 11/06/09, 16:36 updated 10/02/18, 12:26

Description

  • Open the RTE
  • Create a paragraph and apply multiple text styles to a part of the paragraph.
  • During the saving process the classes get lost even if they are allowed.
  • The same seems to work for a complete paragraph.

I’ve figured out that there are two problems:

In the Method HTMLparserConfig the list of allowed
tags will be overwritten with an expoded string.

Line 1256 ad 1257:

if (strcmp($keepTags[$key][‘fixAttrib’][$atName][‘range’],’‘)) $keepTags[$key][‘fixAttrib’][$atName][‘range’] = t3lib_div::trimExplode(‘,’,$keepTags[$key][‘fixAttrib’][$atName][‘range’]);
if (strcmp($keepTags[$key][‘fixAttrib’][$atName][‘list’],’‘)) $keepTags[$key][‘fixAttrib’][$atName][‘list’] = t3lib_div::trimExplode(‘,’,$keepTags[$key][‘fixAttrib’][$atName][‘list’]);

But at runtime $keepTags[$key][‘fixAttrib’][$atName][‘range’] contains an array, not a string. Therefor The Sting “Array” is afterwards content of $keepTags[$key][‘fixAttrib’][$atName][‘list’].

In my opinion we need to check first if the value is realy a string and if
not, we shouln’t do anything:

Second Problem:

In the method HTMLcleaner the handling of a list need to be enhanced to allow the user to use MultipleListItems. To solve this i’ve introduced an configuration option “allowMultipleListItems”

(issue imported from #M12496)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.