diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-12-13 22:44:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 22:44:43 +0300 |
commit | 5b48e4f57dd62c1a3188e1f6b8cdbbaf47635104 (patch) | |
tree | 979174a929eff506916ddb9898470e638f7185ff /libs | |
parent | 6c8c11821562a05e404ee5588e26074024d79729 (diff) |
Prevent memory error when using PHP8 and a session error happens (#16943)
Noticed it exceeded 512MB, then 2GB, ...
It was running in an endless loop because
> PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Zend_Session_Exception::handleSessionStartError(), 4 passed and exactly 5 expected i
See https://www.php.net/manual/en/function.set-error-handler.php
> Since PHP 8: errcontext was removed, and will no longer be passed to user callbacks.
There might be also other places where we maybe use error handler
Diffstat (limited to 'libs')
-rw-r--r-- | libs/Zend/Session/Exception.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/Zend/Session/Exception.php b/libs/Zend/Session/Exception.php index b1ce8fc6ac..ecbd97e99f 100644 --- a/libs/Zend/Session/Exception.php +++ b/libs/Zend/Session/Exception.php @@ -54,7 +54,7 @@ class Zend_Session_Exception extends Zend_Exception * @param string $errstr * @return void */ - static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext) + static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext = '') { $message = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr; if (E_ERROR === $errno || E_CORE_ERROR === $errno || E_COMPILE_ERROR === $errno) { @@ -72,7 +72,7 @@ class Zend_Session_Exception extends Zend_Exception * @param string $errstr * @return void */ - static public function handleSilentWriteClose($errno, $errstr, $errfile, $errline, $errcontext) + static public function handleSilentWriteClose($errno, $errstr, $errfile, $errline, $errcontext = '') { self::$sessionStartError .= PHP_EOL . $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr; } |