Skip to content

Commit ddf3f9b

Browse files
committed
- MFH: Remove HTML fragments from phpcredits() in CLI mode
1 parent 529263d commit ddf3f9b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ext/standard/credits.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,23 @@
2121

2222
#include "php.h"
2323
#include "info.h"
24+
#include "SAPI.h"
2425

2526
#define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors)
2627

2728
/* {{{ php_print_credits
2829
*/
2930
PHPAPI void php_print_credits(int flag TSRMLS_DC)
3031
{
31-
if (flag & PHP_CREDITS_FULLPAGE) {
32+
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
3233
php_print_info_htmlhead(TSRMLS_C);
3334
}
3435

35-
PUTS("<h1>PHP Credits</h1>\n");
36+
if (!sapi_module.phpinfo_as_text) {
37+
PUTS("<h1>PHP Credits</h1>\n");
38+
} else {
39+
PUTS("PHP Credits\n");
40+
}
3641

3742
if (flag & PHP_CREDITS_GROUP) {
3843
/* Group */
@@ -46,7 +51,11 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
4651
if (flag & PHP_CREDITS_GENERAL) {
4752
/* Design & Concept */
4853
php_info_print_table_start();
49-
php_info_print_table_header(1, "Language Design &amp; Concept");
54+
if (!sapi_module.phpinfo_as_text) {
55+
php_info_print_table_header(1, "Language Design &amp; Concept");
56+
} else {
57+
php_info_print_table_header(1, "Language Design & Concept");
58+
}
5059
php_info_print_table_row(1, "Andi Gutmans, Rasmus Lerdorf, Zeev Suraski");
5160
php_info_print_table_end();
5261

@@ -109,7 +118,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
109118
php_info_print_table_end();
110119
}
111120

112-
if (flag & PHP_CREDITS_FULLPAGE) {
121+
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
113122
PUTS("</div></body></html>\n");
114123
}
115124
}

0 commit comments

Comments
 (0)