[BUGFIX] HTMLparser, treat fixAttrib.unset as boolean
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 28 Aug 2011 19:13:03 +0000 (14:13 -0500)
committerJigal van Hemert <jigal@xs4all.nl>
Mon, 29 Aug 2011 17:59:44 +0000 (19:59 +0200)
HTMLparser_tags fixAttrib.unset is documented to be boolean, but is
currently treated as string.
This patch corrects for the expected behavior.

Change-Id: Ib7e9d179ae21f59fc650a4e5c95c08ec6ec38e19
Resolves: #29246
Releases: 4.6, 4.5, 4.4, 4.3
Reviewed-on: http://review.typo3.org/4647
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
t3lib/class.t3lib_parsehtml.php

index 835e3fd..803e1ed 100644 (file)
@@ -801,7 +801,7 @@ class t3lib_parsehtml       {
                                                                        reset($tags[$tagName]['fixAttrib']);
                                                                        while(list($attr,$params)=each($tags[$tagName]['fixAttrib']))   {
                                                                                if (strlen($params['set']))     $tagAttrib[0][$attr] = $params['set'];
-                                                                               if (strlen($params['unset']))   unset($tagAttrib[0][$attr]);
+                                                                               if (isset($params['unset']) && !empty($params['unset'])))       unset($tagAttrib[0][$attr]);
                                                                                if (strcmp($params['default'],'') && !isset($tagAttrib[0][$attr]))      $tagAttrib[0][$attr]=$params['default'];
                                                                                if ($params['always'] || isset($tagAttrib[0][$attr]))   {
                                                                                        if ($params['trim'])    {$tagAttrib[0][$attr]=trim($tagAttrib[0][$attr]);}