Bug #53188

REDIRECT_TYPO3_DISABLE_CORE_UPDATER ignored

Added by Mathias Brodala almost 6 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
Start date:
2013-11-27
Due date:
2013-11-27
% Done:

100%

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

Description

Using Apache mod_rewrite in certain setups makes environment variables from original requests available in the target request as REDIRECT_<envvar>, thus setting TYPO3_DISABLE_CORE_UPDATER becomes REDIRECT_TYPO3_DISABLE_CORE_UPDATER.

The latter is currently not considered by TYPO3, thus the core updater cannot be disabled via the environment variable and the mentioned setup.

See this Stackoverflow post for an explanation and link to the Apache source code.

53188.patch View - Respect REDIRECT_TYPO3_DISABLE_CORE_UPDATER environment variable (591 Bytes) Mathias Brodala, 2013-10-29 14:51

53188-getindpenv.patch View - Implementation via GeneralUtility::getIndpEnv (3.38 KB) Mathias Brodala, 2014-03-05 14:33


Related issues

Related to TYPO3 Core - Bug #58358: Use REDIRECT_TYPO3_CONTEXT as fallback for TYPO3_CONTEXT environment variable Closed 2014-04-30
Follows TYPO3 Core - Feature #52639: ext:install Environment variable to deactivate core update Closed 2013-10-09
Follows TYPO3 Core - Bug #53974: Environment variables prefixed with REDIRECT_ ignored Closed 2013-11-26

Associated revisions

Revision f2ef9fab (diff)
Added by Steffen Müller over 5 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 Philipp Gampe almost 6 years ago

  • Status changed from New to Accepted

Can you create a patch for this? http://wiki.typo3.org/CWT

#2 Updated by Mathias Brodala almost 6 years ago

Here's the patch, as the way written in the CWT is far from trivial but the actual fix is.

#3 Updated by Alexander Stehlik almost 6 years ago

Should this be moved to GeneralUtility::getIndpEnv()?

#4 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/25123

#5 Updated by Mathias Brodala over 5 years ago

Philipp Gampe wrote:

Can you create a patch for this? http://wiki.typo3.org/CWT

I now did this by modifying the existing change as written in the CWT, not sure if it ends up on the review server. Attached is the same change as patch in case it doesn't.

This patch enables retrieving REDIRECT_TYPO3_DISABLE_CORE_UPDATER via GeneralUtility::getIndpEnv() and adds GeneralUtility::getRedirectEnvironmentVariable() for reading an environment variable possibly prefixed by REDIRECT_ (up to 5 times).

#6 Updated by Gerrit Code Review over 5 years ago

Patch set 2 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 Mathias Brodala over 5 years ago

Gerrit Code Review wrote:

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

Now it worked and was my fault: I did clone my local TYPO3.CMS repository to avoid downloading it all again. So obviously the remote URL was not git.typo3.org and thus everything failed.

#8 Updated by Gerrit Code Review over 5 years ago

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

#9 Updated by Gerrit Code Review over 5 years ago

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

#10 Updated by Helmut Hummel over 5 years ago

Before moving further: What is on exact use case/ configuration where we will be affected by this?

In particular:

Using Apache mod_rewrite in certain setups

What are these certain setups?

#11 Updated by Mathias Brodala over 5 years ago

Helmut Hummel wrote:

Before moving further: What is on exact use case/ configuration where we will be affected by this?

In particular:

Using Apache mod_rewrite in certain setups

What are these certain setups?

See the docblock for the new GeneralUtility::getEnvironmentVariableWithRedirectPrefix() method:

Returns an environment variable taking possible "REDIRECT_"
prefixes into account (e.g. due to PHP running in CGI mode)

Thus the following combination is affected: Apache + mod_rewrite + PHP (CGI)

I admit that the mod_rewrite part is not mentioned in the docblock. Should it be added?

#12 Updated by Chris topher over 5 years ago

  • Subject changed from REDIRECT_TYPO3_DISABLED_CORE_UPDATER ignored to REDIRECT_TYPO3_DISABLE_CORE_UPDATER ignored

#13 Updated by Mathias Brodala over 5 years ago

Apparently the same issue also appears with PHP in FastCGI.

#14 Updated by Gerrit Code Review over 5 years ago

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

#15 Updated by Gerrit Code Review over 5 years ago

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

#16 Updated by Gerrit Code Review over 5 years ago

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

#17 Updated by Gerrit Code Review over 5 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

#18 Updated by Gerrit Code Review over 5 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

#19 Updated by Steffen Müller over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#20 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF