Skip to content

Commit 1b4ec1e

Browse files
committed
Merge pull request #31 from zelgerj/master
fixed bug where phpinfo as text granted non cli sapis
2 parents bc5cceb + 8b24f30 commit 1b4ec1e

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/appserver.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ PHP_MINIT_FUNCTION(appserver)
205205
{
206206
REGISTER_INI_ENTRIES();
207207

208-
/* Reset phpinfo output to be non text if defined in ini settings */
209-
sapi_module.phpinfo_as_text = INI_INT("appserver.phpinfo_as_text");
208+
/* Reset phpinfo output to be non text if defined in ini settings for sapi cli only */
209+
if (strcmp(sapi_module.name, "cli") == 0) {
210+
sapi_module.phpinfo_as_text = INI_INT("appserver.phpinfo_as_text");
211+
}
210212

211213
/* init globals */
212214
ZEND_INIT_MODULE_GLOBALS(appserver, php_appserver_init_globals, NULL);

src/tests/appserver_016.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ appserver: call phpinfo and check if is in text format
33
--CREDITS--
44
Johann Zelger <jz [at] techdivision [dot] com>
55
--INI--
6-
appserver.phpinfo_as_text = 1
6+
appserver.phpinfo_as_text = 0
77
--FILE--
88
<?php
99
phpinfo();
1010
--EXPECTF--
11-
phpinfo()
12-
%a
11+
<%a

src/tests/appserver_017.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
appserver: call phpinfo and check if is in non text format
3+
--CREDITS--
4+
Johann Zelger <jz [at] techdivision [dot] com>
5+
--INI--
6+
appserver.phpinfo_as_text = 0
7+
--FILE--
8+
<?php
9+
phpinfo();
10+
--EXPECTF--
11+
<%a

0 commit comments

Comments
 (0)