Fixed endless page retrieval if pageNotFound_handling is set to URL of a local non...
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 31 Jul 2006 07:34:35 +0000 (07:34 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 31 Jul 2006 07:34:35 +0000 (07:34 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1665 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index a607233..d7f2bba 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-31  Dmitry Dulepov  <typo3@accio.lv>
+
+       * Fixed endless page retrieval if pageNotFound_handling is set to URL of a local non existing page
+
 2006-07-31  Michael Stucki  <michael@typo3.org>
 
        * Updates to NEWS.txt (thanks to Martin Kutschker)
index b91a11b..a0c9153 100755 (executable)
                        // Create response:
                if (gettype($code)=='boolean' || !strcmp($code,1))      {       // Simply boolean; Just shows TYPO3 error page with reason:
                        $this->printError('The page did not exist or was inaccessible.'.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
-                       exit;
                } elseif (t3lib_div::isFirstPartOfStr($code,'USER_FUNCTION:')) {
                        $funcRef = trim(substr($code,14));
                        $params = array(
                                'pageAccessFailureReasons' => $this->getPageAccessFailureReasons()
                        );
                        echo t3lib_div::callUserFunction($funcRef,$params,$this);
-                       exit;
                } elseif (t3lib_div::isFirstPartOfStr($code,'READFILE:')) {
                        $readFile = t3lib_div::getFileAbsFileName(trim(substr($code,9)));
                        if (@is_file($readFile))        {
                        } else {
                                $this->printError('Configuration Error: 404 page "'.$readFile.'" could not be found.');
                        }
-                       exit;
                } elseif (strlen($code))        {
                                // Check if URL is relative
                        $url_parts = parse_url($code);
                        } else {
                                $checkBaseTag = true;
                        }
+
+                               // Check recursion
+                       if ($code == t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) {
+                               if ($reason == '') {
+                                       $reason = 'Page cannot be found.';
+                               }
+                               $reason .= chr(10) . chr(10) . 'Additionally ' . $code . ' was not found while trying to retrieve the error document.';
+                               $this->printError('Reason: '.nl2br(htmlspecialchars($reason)));
+                               exit();
+                       }
+
                                // Prepare headers
                        $headers = array(
                                'User-agent: ' . t3lib_div::getIndpEnv('HTTP_USER_AGENT'),
                                }
                                echo $content;  // Output the content
                        }
-                       exit;
                } else {
-                       $this->printError('Error.'.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
-                       exit;
+                       $this->printError($reason ? 'Reason: '.htmlspecialchars($reason) : 'Page cannot be found.');
                }
+               exit();
        }
 
        /**