Project

General

Profile

Actions

Bug #38392

closed

TYPO3_DOCUMENT_ROOT wrong if reverseProxyPrefix/reverseProxyPrefixSSL used

Added by Stefan Neufeind almost 12 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2012-06-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If reverseProxyPrefix or reverseProxyPrefixSSL is used an incorrect path for TYPO3_DOCUMENT_ROOT is generated in t3lib/class.t3lib_div.php (around line 4000).

The TYPO3_DOCUMENT_ROOT is determined by taking SCRIPT_FILENAME and removing SCRIPT_NAME from the end. That would work as expected if $_SERVER[...] or the like would be used. However self::getIndpEnv('SCRIPT_NAME') is used. And in case the call comes through a proxy that variable gets prepended reverseProxyPrefix or reverseProxyPrefixSSL. And thus the TYPO3_DOCUMENT_ROOT becomes wrong (points to the wrong directory, which usually doesn't exist!).

This has been in TYPO3 since at least 2010. But imho the ProxyPrefix-functionality is not that commonly used that many people might have noticed. And also not all/not many extensions use TYPO3_DOCUMENT_ROOT to access files imho.

Special-case we experienced: prefix being the last part of document-root.
URL with proxy: https://www.example.com/somehost.somewhere/xyz.php
URL internal : http://somehost.somewhere/index.php
filename on disk: /home/somebody/somehost.somewhere/index.php
TYPO3_DOCUMENT_ROOT then becomes: /home/somebody
(somehost.somewhere is stripped too much).

@Steffen: Imho itt seems you contributed the major part of this proxy-prefix-thing ...
c73d1301 (Steffen Kamper 2010-11-23 18:52:50 +0000 3508) $SN_A = explode('/', strrev(self::getIndpEnv('SCRIPT_NAME')));


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #25266: allow redirect to ssl reverse proxyClosed2011-03-07

Actions
Actions

Also available in: Atom PDF