cvs: php-src /main php_variables.c
| From: | Wez Furlong | Date: | Tue, 19 Jul 2005 18:59:47 +0000 |
| Subject: | cvs: php-src /main php_variables.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-32993@lists.php.net to get a copy of this message | ||
wez Tue Jul 19 14:59:47 2005 EDT
Modified files:
/php-src/main php_variables.c
Log:
Don't crash when no treat_data method has been set in the sapi module
# how come no one ran into this before?
http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.98&r2=1.99&ty=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.98 php-src/main/php_variables.c:1.99
--- php-src/main/php_variables.c:1.98 Mon Jul 18 15:18:03 2005
+++ php-src/main/php_variables.c Tue Jul 19 14:59:46 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.98 2005/07/18 19:18:03 iliaa Exp $ */
+/* $Id: php_variables.c,v 1.99 2005/07/19 18:59:46 wez Exp $ */
#include <stdio.h>
#include "php.h"
@@ -625,7 +625,9 @@
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 @@
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 @@
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);