Fixed bug #7961: headListTags in class.t3lib_parsehtml_proc.php are hardcoded (Thanks...
authorBenni Mack <benni.mack@typo3.org>
Wed, 2 Apr 2008 09:15:43 +0000 (09:15 +0000)
committerBenni Mack <benni.mack@typo3.org>
Wed, 2 Apr 2008 09:15:43 +0000 (09:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3514 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_parsehtml_proc.php

index 9f67e92..2796f93 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-02  Benjamin Mack <benni@typo3.org>
+
+       * Fixed bug #7961: headListTags in class.t3lib_parsehtml_proc.php are hardcoded (Thanks to Steffen Kamper)
+
 2008-04-01  Ingo Renner  <ingo@typo3.org>
 
        * Release of TYPO3 4.2.0RC1
 2008-04-01  Ingo Renner  <ingo@typo3.org>
 
        * Release of TYPO3 4.2.0RC1
index a2bc274..b2020eb 100755 (executable)
@@ -103,7 +103,7 @@ require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
 class t3lib_parsehtml_proc extends t3lib_parsehtml {
 
                // Static:
 class t3lib_parsehtml_proc extends t3lib_parsehtml {
 
                // Static:
-       var $headListTags = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,HR,ADDRESS,DL,DD';     // List of tags for these elements
+       var $blockElementList = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,HR,ADDRESS,DL,DD'; // List of tags for these elements
 
                // Internal, static:
        var $recPid = 0;                                // Set this to the pid of the record manipulated by the class.
 
                // Internal, static:
        var $recPid = 0;                                // Set this to the pid of the record manipulated by the class.
@@ -234,7 +234,12 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                        // Init:
                $this->procOptions = $thisConfig['proc.'];
                $this->preserveTags = strtoupper(implode(',',t3lib_div::trimExplode(',',$this->procOptions['preserveTags'])));
                        // Init:
                $this->procOptions = $thisConfig['proc.'];
                $this->preserveTags = strtoupper(implode(',',t3lib_div::trimExplode(',',$this->procOptions['preserveTags'])));
-
+               
+                       // dynamic configuration of blockElementList
+               if ($this->procOptions['blockElementList']) {
+                       $this->blockElementList = $this->procOptions['blockElementList'];
+               }
+               
                        // Get parameters for rte_transformation:
                $p = $this->rte_p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
 
                        // Get parameters for rte_transformation:
                $p = $this->rte_p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
 
@@ -811,7 +816,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                if ($this->TS_transform_db_safecounter<0)       return $value;
 
                        // Split the content from RTE by the occurence of these blocks:
                if ($this->TS_transform_db_safecounter<0)       return $value;
 
                        // Split the content from RTE by the occurence of these blocks:
-               $blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$value);
+               $blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$value);
 
                $cc=0;
                $aC = count($blockSplit);
 
                $cc=0;
                $aC = count($blockSplit);
@@ -952,7 +957,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
        function TS_transform_rte($value,$css=0)        {
 
                        // Split the content from Database by the occurence of these blocks:
        function TS_transform_rte($value,$css=0)        {
 
                        // Split the content from Database by the occurence of these blocks:
-               $blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$value);
+               $blockSplit = $this->splitIntoBlock('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$value);
 
                        // Traverse the blocks
                foreach($blockSplit as $k => $v)        {
 
                        // Traverse the blocks
                foreach($blockSplit as $k => $v)        {
@@ -1001,7 +1006,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                        } else {        // NON-block:
                                $nextFTN = $this->getFirstTagName($blockSplit[$k+1]);
                                $singleLineBreak = $blockSplit[$k]==chr(10);
                        } else {        // NON-block:
                                $nextFTN = $this->getFirstTagName($blockSplit[$k+1]);
                                $singleLineBreak = $blockSplit[$k]==chr(10);
-                               if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->headListTags,$nextFTN))        {       // Removing linebreak if typolist/typohead
+                               if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$nextFTN))    {       // Removing linebreak if typolist/typohead
                                        $blockSplit[$k] = ereg_replace(chr(10).'[ ]*$','',$blockSplit[$k]);
                                }
                                        // If $blockSplit[$k] is blank then unset the line. UNLESS the line happend to be a single line break.
                                        $blockSplit[$k] = ereg_replace(chr(10).'[ ]*$','',$blockSplit[$k]);
                                }
                                        // If $blockSplit[$k] is blank then unset the line. UNLESS the line happend to be a single line break.