Skip to content

Commit 1d2bbce

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
2 parents 6dcd640 + 073b6ea commit 1d2bbce

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PHP NEWS
99
- Session:
1010
. Fixed bug #80774 (session_name() problem with backslash). (cmb)
1111

12+
- Standard:
13+
. Fixed bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI). (cmb)
14+
1215
18 Feb 2021, PHP 8.0.3
1316

1417
- Core:

ext/standard/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ PHPAPI ZEND_COLD void php_print_info(int flag)
995995
}
996996

997997

998-
if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
998+
if (flag & PHP_INFO_CREDITS) {
999999
php_info_print_hr();
10001000
php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE);
10011001
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI)
3+
--FILE--
4+
<?php
5+
ob_start();
6+
phpinfo(INFO_CREDITS);
7+
$info = ob_get_clean();
8+
9+
ob_start();
10+
phpcredits();
11+
$credits = ob_get_clean();
12+
13+
var_dump(strpos($info, $credits) !== false);
14+
?>
15+
--EXPECT--
16+
bool(true)

sapi/cli/php_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
627627
goto err;
628628
}
629629
request_started = 1;
630-
php_print_info(0xFFFFFFFF);
630+
php_print_info(PHP_INFO_ALL & ~PHP_INFO_CREDITS);
631631
php_output_end_all();
632632
EG(exit_status) = (c == '?' && argc > 1 && !strchr(argv[1], c));
633633
goto out;

0 commit comments

Comments
 (0)