diff options
author | Wez Furlong <wez@php.net> | 2005-07-19 18:59:46 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2005-07-19 18:59:46 +0000 |
commit | 546418a66b4df839325419eb70616357c0b55ffe (patch) | |
tree | 841fc9bb5fdfe5cdd2eec6c6051c4167c3d6099f /main/php_variables.c | |
parent | d4348d11dda04d87264d20542110dbf4bb7c60ab (diff) | |
download | php-git-546418a66b4df839325419eb70616357c0b55ffe.tar.gz |
Don't crash when no treat_data method has been set in the sapi module
# how come no one ran into this before?
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/main/php_variables.c b/main/php_variables.c index b468c51df0..c6bdbbff47 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -625,7 +625,9 @@ int php_hash_environment(TSRMLS_D) case 'p': case 'P': if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcasecmp(SG(request_info).request_method, "POST")) { - sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC); /* POST Data */ + if (sapi_module.treat_data) { + sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC); /* POST Data */ + } _gpc_flags[0] = 1; if (PG(register_globals)) { php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC); @@ -635,7 +637,9 @@ int php_hash_environment(TSRMLS_D) case 'c': case 'C': if (!_gpc_flags[1]) { - sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC); /* Cookie Data */ + if (sapi_module.treat_data) { + sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC); /* Cookie Data */ + } _gpc_flags[1] = 1; if (PG(register_globals)) { php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC); @@ -645,7 +649,9 @@ int php_hash_environment(TSRMLS_D) case 'g': case 'G': if (!_gpc_flags[2]) { - sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC); /* GET Data */ + if (sapi_module.treat_data) { + sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC); /* GET Data */ + } _gpc_flags[2] = 1; if (PG(register_globals)) { php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC); |