Skip to content

Commit

Permalink
[BUGFIX] Cast values always to string before applying through ini_set
Browse files Browse the repository at this point in the history
Resolves: #83826
Releases: master
Change-Id: I55d7141ffb26126215be029547e143ed2f777707
Reviewed-on: https://review.typo3.org/55629
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: TYPO3com <no-reply@typo3.com>
  • Loading branch information
Benjamin Kott authored and lolli42 committed Feb 9, 2018
1 parent 201e050 commit 63e26be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -52,7 +52,7 @@ protected function initializeOutputCompression()
{
if (extension_loaded('zlib') && $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']) {
if (MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'])) {
@ini_set('zlib.output_compression_level', $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']);
@ini_set('zlib.output_compression_level', (string)$GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']);
}
ob_start('ob_gzhandler');
}
Expand Down
6 changes: 3 additions & 3 deletions typo3/sysext/core/Classes/Core/Bootstrap.php
Expand Up @@ -633,7 +633,7 @@ protected function initializeErrorHandling()
);
}
}
@ini_set('display_errors', $displayErrors);
@ini_set('display_errors', (string)$displayErrors);

if (!empty($errorHandlerClassName)) {
// Register an error handler for the given errorHandlerError
Expand All @@ -659,7 +659,7 @@ protected function initializeErrorHandling()
protected function setMemoryLimit()
{
if ((int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit'] > 16) {
@ini_set('memory_limit', ((int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit'] . 'm'));
@ini_set('memory_limit', (string)((int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit'] . 'm'));
}
return $this;
}
Expand Down Expand Up @@ -972,7 +972,7 @@ public function initializeOutputCompression()
{
if (extension_loaded('zlib') && $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']) {
if (MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'])) {
@ini_set('zlib.output_compression_level', $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']);
@ini_set('zlib.output_compression_level', (string)$GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']);
}
ob_start('ob_gzhandler');
}
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/frontend/Classes/Http/RequestHandler.php
Expand Up @@ -322,7 +322,7 @@ protected function initializeOutputCompression()
{
if ($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] && extension_loaded('zlib')) {
if (MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'])) {
@ini_set('zlib.output_compression_level', $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel']);
@ini_set('zlib.output_compression_level', (string)$GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel']);
}
ob_start([GeneralUtility::makeInstance(CompressionUtility::class), 'compressionOutputHandler']);
}
Expand Down
8 changes: 4 additions & 4 deletions typo3/sysext/install/Classes/Service/SessionService.php
Expand Up @@ -74,11 +74,11 @@ public function __construct()
session_set_save_handler([$this, 'open'], [$this, 'close'], [$this, 'read'], [$this, 'write'], [$this, 'destroy'], [$this, 'gc']);
session_save_path($sessionSavePath);
session_name($this->cookieName);
ini_set('session.cookie_path', GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'));
ini_set('session.cookie_path', (string)GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'));
// Always call the garbage collector to clean up stale session files
ini_set('session.gc_probability', 100);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', $this->expireTimeInMinutes * 2 * 60);
ini_set('session.gc_probability', (string)100);
ini_set('session.gc_divisor', (string)100);
ini_set('session.gc_maxlifetime', (string)$this->expireTimeInMinutes * 2 * 60);
if (\TYPO3\CMS\Core\Utility\PhpOptionsUtility::isSessionAutoStartEnabled()) {
$sessionCreationError = 'Error: session.auto-start is enabled.<br />';
$sessionCreationError .= 'The PHP option session.auto-start is enabled. Disable this option in php.ini or .htaccess:<br />';
Expand Down

0 comments on commit 63e26be

Please sign in to comment.