summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--ext/standard/info.c2
-rw-r--r--ext/standard/tests/general_functions/bug80771.phpt16
-rw-r--r--sapi/cli/php_cli.c2
4 files changed, 21 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index e1e06c297d..3eebeaa826 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ PHP NEWS
- Session:
. Fixed bug #80774 (session_name() problem with backslash). (cmb)
+- Standard:
+ . Fixed bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI). (cmb)
+
18 Feb 2021, PHP 8.0.3
- Core:
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 153cb6cde0..0e461117f0 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -995,7 +995,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 0000000000..a8c9e7b542
--- /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--
+<?php
+ob_start();
+phpinfo(INFO_CREDITS);
+$info = ob_get_clean();
+
+ob_start();
+phpcredits();
+$credits = ob_get_clean();
+
+var_dump(strpos($info, $credits) !== false);
+?>
+--EXPECT--
+bool(true)
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index d28f5a5378..330c91d58b 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -627,7 +627,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();
EG(exit_status) = (c == '?' && argc > 1 && !strchr(argv[1], c));
goto out;