Bug #58358

Use REDIRECT_TYPO3_CONTEXT as fallback for TYPO3_CONTEXT environment variable

Added by Steffen Müller almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
Start date:
2014-04-30
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

On certain server setups, setting ApplicationContext fails, because the environment variable TYPO3_CONTEXT is never set.

The reason is that variables set by mod_rewrite get prefixed with REDIRECT_
This seems to appear in PHP-FPM setups, which is quite popular these days.

htaccess file:
 RewriteCond %{HTTP_HOST} ^dev\.example\.com$
 RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Development]
Test:
echo $_SERVER['TYPO3_CONTEXT'];

echo $_SERVER['REDIRECT_TYPO3_CONTEXT'];
Development

Flow solves this by using REDIRECT_FLOW3_CONTEXT as fallback in index.php:

$context = getenv('FLOW3_CONTEXT') ?: (getenv('REDIRECT_FLOW3_CONTEXT') ?: 'Development');

We should backport this fallback to Bootstrap.


Related issues

Related to TYPO3 Core - Bug #53188: REDIRECT_TYPO3_DISABLE_CORE_UPDATER ignored Closed 2013-11-27 2013-11-27
Related to TYPO3 Core - Bug #53974: Environment variables prefixed with REDIRECT_ ignored Closed 2013-11-26

Associated revisions

Revision f2ef9fab (diff)
Added by Steffen Müller almost 6 years ago

[BUGFIX] Use REDIRECT_ prefix as fallback for environment variables

The core uses values of environment variables for
disabling the core updater and to determine the
application context.

When setting the variable with mod_rewrite, certain server environments
prefix the variable name with REDIRECT_.
To ensure compatibility for this case, REDIRECT_
prefix is prepended as a fallback if the regular
variable is not set.

Resolves: #53188
Resolves: #58358
Resolves: #53974
Releases: 6.2
Change-Id: Iaba7f936ff1362d1f70426ec8ad1b1821e4e0d3c
Reviewed-on: https://review.typo3.org/25123
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller

History

#1 Updated by Helmut Hummel almost 6 years ago

  • Status changed from New to Closed

Duplicate of #53188

#2 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Closed to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29742

#3 Updated by Steffen Müller almost 6 years ago

Sorry Helmut, I pushed without noticing the duplicate.
Nevertheless, please don't close issues which are duplicates of yet unresolved. AFAIK the policy was to leave dups until the parent issue was resolved and then close all dups.

Beside that, I don't agree this is a duplicate, but rather an issue which is related to the parent. the pending solution of the parent does not fix this issue.

#4 Updated by Steffen Müller almost 6 years ago

  • Status changed from Under Review to Needs Feedback

#5 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25123

#6 Updated by Gerrit Code Review almost 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25123

#7 Updated by Gerrit Code Review almost 6 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25123

#8 Updated by Steffen Müller almost 6 years ago

  • Status changed from Under Review to Closed

Also available in: Atom PDF