From d721c4a2f969f59f44cd65fdd08805898ce7d978 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 18 Feb 2021 18:20:48 +0100 Subject: [PATCH 1/3] Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI There is no good reason not to show the credits in text based SAPIs. --- ext/standard/info.c | 2 +- .../tests/general_functions/bug80771.phpt | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/general_functions/bug80771.phpt diff --git a/ext/standard/info.c b/ext/standard/info.c index 1e58b31a0fb25..ac2709705555e 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1000,7 +1000,7 @@ PHPAPI ZEND_COLD void php_print_info(int flag) } - if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) { + if ((flag & PHP_INFO_CREDITS)) { php_info_print_hr(); php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE); } diff --git a/ext/standard/tests/general_functions/bug80771.phpt b/ext/standard/tests/general_functions/bug80771.phpt new file mode 100644 index 0000000000000..a8c9e7b542936 --- /dev/null +++ b/ext/standard/tests/general_functions/bug80771.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI) +--FILE-- + +--EXPECT-- +bool(true) From a7f018444503d1d2a8ecf20e3262415023320e98 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 19 Feb 2021 12:17:27 +0100 Subject: [PATCH 2/3] Remove redundant parens --- ext/standard/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/info.c b/ext/standard/info.c index ac2709705555e..8e21d77f137c7 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1000,7 +1000,7 @@ PHPAPI ZEND_COLD void php_print_info(int flag) } - if ((flag & PHP_INFO_CREDITS)) { + if (flag & PHP_INFO_CREDITS) { php_info_print_hr(); php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE); } From f8fc2bc576c0d669789f66f25853d96cf6f49bd7 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 22 Feb 2021 12:24:15 +0100 Subject: [PATCH 3/3] Exclude credits from php -i for brevity --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 91f400aca4cfd..0fd167de63d5a 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -642,7 +642,7 @@ static int do_cli(int argc, char **argv) /* {{{ */ goto err; } request_started = 1; - php_print_info(0xFFFFFFFF); + php_print_info(PHP_INFO_ALL & ~PHP_INFO_CREDITS); php_output_end_all(); exit_status = (c == '?' && argc > 1 && !strchr(argv[1], c)); goto out;