* Fixed bug #4059: options.hideRecords.pages doesn't work for mounted pages
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 17 Nov 2006 18:42:41 +0000 (18:42 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 17 Nov 2006 18:42:41 +0000 (18:42 +0000)
       * Fixed bug #4379: pageNotFound_handling ignores forceCharset setting

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-0@1797 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_browsetree.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index bfc4f75..1f10727 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-17  Michael Stucki  <michael@typo3.org>
+
+       * Fixed bug #4059: options.hideRecords.pages doesn't work for mounted pages
+       * Fixed bug #4379: pageNotFound_handling ignores forceCharset setting
 
 2006-11-16  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index 0779a58..5ba4fef 100755 (executable)
@@ -100,6 +100,12 @@ class t3lib_browseTree extends t3lib_treeView {
                $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                $this->MOUNTS = $GLOBALS['WEBMOUNTS'];
 
+               if ($pidList)   {
+                               // Remove mountpoint if explicitely set in options.hideRecords.pages (see above)
+                       $hideList = explode(',',$pidList);
+                       $this->MOUNTS = array_diff($this->MOUNTS,$hideList);
+               }
+
                $this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id','t3ver_state','t3ver_wsid','t3ver_swapmode'));
                if (t3lib_extMgm::isLoaded('cms'))      {
                        $this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages'));
index 8ce6665..7ee04ea 100755 (executable)
         * @return      void            (The function exits!)
         */
        function pageNotFoundHandler($code, $header='', $reason='')     {
+
                        // Issue header in any case:
-               if ($header)    {header($header);}
+               if ($header)    {
+                       $headerArr = preg_split('/\r|\n/',$header,-1,PREG_SPLIT_NO_EMPTY);
+                       foreach ($headerArr as $header) {
+                               header ($header);
+                       }
+               }
 
                        // Convert $code in case it was written as a string (e.g. if edited in Install Tool)
                        // TODO: Once the Install Tool handles such data types correctly, this workaround should be removed again...
                        }
 
                                // Prepare headers
-                       $headers = array(
+                       $headerArr = array(
                                'User-agent: ' . t3lib_div::getIndpEnv('HTTP_USER_AGENT'),
                                'Referer: ' . t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')
                        );
-                       $content = t3lib_div::getURL($code, 0, $headers);
+                       $res = t3lib_div::getURL($code, 1, $headerArr);
+
+                               // Header and content are separated by an empty line
+                       list($header,$content) = split("\r\n\r\n", $res, 2);
+                       $content.= "\r\n";
+
                        if (false === $content) {
                                        // Last chance -- redirect
                                header('Location: '.t3lib_div::locationHeaderUrl($code));
                        } else {
+
+                               $forwardHeaders = array(        // Forward these response headers to the client
+                                       'Content-Type:',
+                               );
+                               $headerArr = preg_split('/\r|\n/',$header,-1,PREG_SPLIT_NO_EMPTY);
+                               foreach ($headerArr as $header) {
+                                       foreach ($forwardHeaders as $h) {
+                                               $h = preg_quote($h,'/');
+                                               if (preg_match('/^'.$h.'/', $header))   {
+                                                       header ($header);
+                                               }
+                                       }
+                               }
                                        // Put <base> if necesary
                                if ($checkBaseTag)      {