Skip to content

Commit

Permalink
Revert "Remove no longer used "log_errors_max_len" ini directive (#6838
Browse files Browse the repository at this point in the history
…)"

This reverts commit d2d227e.

This is an ABI break.
  • Loading branch information
nikic committed May 8, 2021
1 parent c2b5284 commit 0906270
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 7 deletions.
2 changes: 0 additions & 2 deletions NEWS
Expand Up @@ -8,8 +8,6 @@ PHP NEWS
. Fixed bug #67792 (HTTP Authorization schemes are treated as case-sensitive).
(cmb)
. Fixed bug #80972 (Memory exhaustion on invalid string offset). (girgias)
. Removed log_errors_max_len ini directive from default ini files, since it
no longer had any effect since PHP 8.0.0. (Michael Voříšek)

- FTP:
. Fixed bug #80901 (Info leak in ftp extension). (cmb)
Expand Down
4 changes: 0 additions & 4 deletions UPGRADING
Expand Up @@ -1124,10 +1124,6 @@ PHP 8.0 UPGRADE NOTES
. New INI directive to choose the version of the .NET framework to use for
dotnet objects.

- log_errors_max_len
. INI directive for setting the maximum length of log_errors in bytes no
longer has any effect and has been removed.

========================================
12. Windows Support
========================================
Expand Down
2 changes: 2 additions & 0 deletions ext/ftp/tests/bug80901.phpt
Expand Up @@ -4,6 +4,8 @@ Bug #80901 (Info leak in ftp extension)
<?php
require 'skipif.inc';
?>
--INI--
log_errors_max_len=0
--FILE--
<?php
$bug80901 = true;
Expand Down
2 changes: 2 additions & 0 deletions ext/oci8/tests/error3.phpt
Expand Up @@ -10,6 +10,8 @@ if ($cv[0] < 11 || ($cv[0] == 11 && $cv[1] < 2) || ($cv[0] == 11 && $cv[1] == 2
die("skip test works only with Oracle 11.2.0.3 or greater version of Oracle client libraries");
}
?>
--INI--
log_errors_max_len=4096
--FILE--
<?php

Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/dir/bug80960.phpt
Expand Up @@ -4,6 +4,8 @@ Fix #80960 (opendir() warning wrong info when failed on Windows)
<?php
if (PHP_OS_FAMILY !== "Windows") die("skip for Windows only");
?>
--INI--
log_errors_max_len=0
--FILE--
<?php
opendir("notexist*");
Expand Down
5 changes: 4 additions & 1 deletion ext/standard/tests/file/parse_ini_file_variation3.phpt
Expand Up @@ -33,6 +33,7 @@ error_reporting = E_ALL
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
Expand Down Expand Up @@ -68,7 +69,7 @@ foreach($newdirs as $newdir) {
--EXPECTF--
*** Testing parse_ini_file() : variation ***
New include path is : %sparse_ini_file_variation3.dir1%sparse_ini_file_variation3.dir2%sparse_ini_file_variation3.dir3%S
array(9) {
array(10) {
["error_reporting"]=>
string(5) "32767"
["display_errors"]=>
Expand All @@ -77,6 +78,8 @@ array(9) {
string(0) ""
["log_errors"]=>
string(0) ""
["log_errors_max_len"]=>
string(4) "1024"
["ignore_repeated_errors"]=>
string(0) ""
["ignore_repeated_source"]=>
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/strings/006.phpt
@@ -1,5 +1,7 @@
--TEST--
highlight_file() and output buffer
--INI--
log_errors_max_len=4096
--FILE--
<?php

Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/strings/007-win32.phpt
Expand Up @@ -2,6 +2,8 @@
php_strip_whitespace() and output buffer
--SKIPIF--
<?php if( substr(PHP_OS, 0, 3) != "WIN") die('skip Windows only test');?>
--INI--
log_errors_max_len=4096
--FILE--
<?php
$file = str_repeat("A", PHP_MAXPATHLEN - strlen(__DIR__ . DIRECTORY_SEPARATOR . __FILE__));
Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/strings/007.phpt
Expand Up @@ -2,6 +2,8 @@
php_strip_whitespace() and output buffer
--SKIPIF--
<?php if( substr(PHP_OS, 0, 3) == "WIN") die('skip Non windows test');?>
--INI--
log_errors_max_len=4096
--FILE--
<?php
$file = str_repeat("A", PHP_MAXPATHLEN - strlen(__DIR__ . DIRECTORY_SEPARATOR . __FILE__));
Expand Down
1 change: 1 addition & 0 deletions main/main.c
Expand Up @@ -659,6 +659,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_ALL, OnUpdateBool, implicit_flush, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("log_errors_max_len", "1024", PHP_INI_ALL, OnUpdateLong, log_errors_max_len, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals)
Expand Down
1 change: 1 addition & 0 deletions main/php_globals.h
Expand Up @@ -68,6 +68,7 @@ struct _php_core_globals {
zend_uchar display_errors;
zend_bool display_startup_errors;
zend_bool log_errors;
zend_long log_errors_max_len;
zend_bool ignore_repeated_errors;
zend_bool ignore_repeated_source;
zend_bool report_memleaks;
Expand Down
5 changes: 5 additions & 0 deletions php.ini-development
Expand Up @@ -519,6 +519,11 @@ display_startup_errors = On
; http://php.net/log-errors
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
; http://php.net/log-errors-max-len
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line unless ignore_repeated_source is set true.
; http://php.net/ignore-repeated-errors
Expand Down
5 changes: 5 additions & 0 deletions php.ini-production
Expand Up @@ -521,6 +521,11 @@ display_startup_errors = Off
; http://php.net/log-errors
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
; http://php.net/log-errors-max-len
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line unless ignore_repeated_source is set true.
; http://php.net/ignore-repeated-errors
Expand Down
1 change: 1 addition & 0 deletions run-tests.php
Expand Up @@ -341,6 +341,7 @@ function main(): void
'precision=14',
'serialize_precision=-1',
'memory_limit=128M',
'log_errors_max_len=0',
'opcache.fast_shutdown=0',
'opcache.file_update_protection=0',
'opcache.revalidate_freq=0',
Expand Down

0 comments on commit 0906270

Please sign in to comment.