Bug #14112
closedPATH_TRANSLATED issues
0%
Description
If you take a look at typo3/init.php there's a conditional statement to get the right path to the current script.
It uses PATH_TRANSLATED which in fact is EMPTY, while ORIG_PATH_TRANSLATED contains the right path.
Several documents say that the NEW variable name is PATH_TRANSLATED, even though I didn't find any concrete documentation for that and saw a phpinfo() from PHP5, where it's exactly the same (PATH_TRANSLATED empty, ...).
(issue imported from #M18)
Updated by old_Dieter over 20 years ago
See http://bugs.php.net/bug.php?id=23610.
It happened something around php 4.3.2,
Updated by Ingmar Schlecht over 20 years ago
Since these path problems are a major roadblock for newbees to install Typo3 but also a very time consuming nasty thing for experienced users, I have done some work for resolving these issues.
Here are some patched files which should handle paths correctly.
t3lib_div, basically changed the function getIndpEnv()
http://typo3.sunsite.dk/.patches/class.t3lib_div.php.txt
Some 'entry scripts' in which the declaration of the constant "PATH_thisScript" had to be fixed:
http://typo3.sunsite.dk/.patches/index.php.txt
http://typo3.sunsite.dk/.patches/showpic.php.txt
http://typo3.sunsite.dk/.patches/init.php.txt
http://typo3.sunsite.dk/.patches/thumbs.php.txt
So what is it I actually changed?
In the function getIndpEnv() I changed the code responsible for getting SCRIPT_NAME and SCRIPT_FILENAME.
In those parts of the code I have
- replaced all occurrences of any PATH_* or SCRIPT_* with for example:
( PATH_INFO ? PATH_INFO : ORIG_PATH_INFO)
So that if PATH_INFO is not set, the corresponding ORIG_* variable is used instead.
(in the above code $HTTP_SERVER_VARS[''] has been removed for easier readability)
- At some places in the code the php_sapi_name "cgi-fcgi" was not recognized at all.
My patch treats "cgi-fcgi" exactly like the normal "cgi"
- A fall back mechanism has been introduced, so if according to the value of php_sapi_name() PATH_TRANSLATED or its corresponding ORIG_* variable should be used but is not available, the code automatically tries to use SCRIPT_FILENAME.
Since the code is still in one line, it's a bit hard to read.
Updated by Ingmar Schlecht over 20 years ago
I fixed this bug in CVS for branch TYPO3_3-6-0.
The fix will be included in a maintanace release within some days.