Skip to content
Commit 739efe45 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[BUGFIX] Ignore PATH_INFO in NormalizedParams scriptName calculation

When NormalizedParams was introduced, the code that was refactored from
GeneralUtility:getIndpEnv did not take into account that PATH_INFO
could be set, but be empty. (which happens with the Debian 9 NGINX
default configuration which uses `fastcgi_split_path_info` and set's
`fastcgi_param PATH_INFO` even if it's empty).

Now, the fallback to PATH_INFO has been introduced with
the initial revision of TYPO3 and isn't needed at all nowadays,
it's actually wrong, as a REQUEST_URI to /index.php/foo/bar
would incorrectly be interpreted as $scriptName == "/foo/bar".

This patch additionally replaces PATH_INFO with SCRIPT_NAME in
test cases where this variable is actually wrong (we assume test cases
have been modeled to match (old) code, instead of reality here):

 * ProxyPass does not result in PATH_INFO being set,
   it's SCRIPT_NAME here.
 * PATH_INFO is not set for regular request
   to /typo3/index.php

Resolves: #88304
Releases: master, 9.5
Change-Id: I501ad3bc10b0988385906a1fe9cb668c5e3696b6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60719


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarBenny Schimmer <b.schimmer@saint-elmos.com>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenny Schimmer <b.schimmer@saint-elmos.com>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent d8bd7129
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment