From: Zeev Suraski Date: Tue, 19 Sep 2000 17:37:34 +0000 (+0000) Subject: - Fix warnings X-Git-Tag: php-4.0.3RC1~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c45b1c2c8b07d2950451980e04b4e50a6af6afb9;p=php - Fix warnings - Fix URL scanner startup crash --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 8260a5ee20..76d8e7cc9a 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2017,7 +2017,7 @@ PHP_FUNCTION(array_reverse) if (ZEND_NUM_ARGS() > 1) { convert_to_boolean_ex(z_preserve_keys); - preserve_keys = Z_LVAL_PP(z_preserve_keys); + preserve_keys = (zend_bool) Z_LVAL_PP(z_preserve_keys); } /* Initialize return array */ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ea3727b08e..974e7ac9a3 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -26,6 +26,7 @@ #include "php_standard.h" #include "php_math.h" #include "ext/standard/info.h" +#include "ext/standard/url_scanner.h" #include "zend_operators.h" #include #include @@ -645,6 +646,11 @@ static void basic_globals_ctor(BLS_D) BG(user_tick_functions) = NULL; zend_hash_init(&BG(sm_protected_env_vars), 5, NULL, NULL, 1); BG(sm_allowed_env_vars) = NULL; + +#ifdef TRANS_SID + memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state))); +#endif + #ifdef PHP_WIN32 CoInitialize(NULL); #endif diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c index 2a79ee97bd..3431dcaa64 100644 --- a/ext/standard/url_scanner.c +++ b/ext/standard/url_scanner.c @@ -35,22 +35,26 @@ #define BUFSIZE 256 #endif -PHP_RINIT_FUNCTION(url_scanner) { +PHP_RINIT_FUNCTION(url_scanner) +{ url_adapt(NULL,0,NULL,NULL); return SUCCESS; } -PHP_RSHUTDOWN_FUNCTION(url_scanner) { + +PHP_RSHUTDOWN_FUNCTION(url_scanner) +{ url_adapt(NULL,0,NULL,NULL); return SUCCESS; } -static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf) { +static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf) +{ int flag = 0; PLS_FETCH(); - if(!strcasecmp(tag,"a")&&!strcasecmp(attr,"href")) { + if(!strcasecmp(tag,"a") && !strcasecmp(attr,"href")) { flag = 1; } else if(!strcasecmp(tag,"area" ) && !strcasecmp(attr,"href" )) { flag = 1; @@ -100,9 +104,9 @@ char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen if(src==NULL) { US.state=STATE_NORMAL; - if(US.tag) {efree(US.tag); US.tag =NULL; } - if(US.attr) {efree(US.attr); US.attr=NULL; } - if(US.val) {efree(US.val); US.val =NULL; } + if(US.tag) { efree(US.tag); US.tag =NULL; } + if(US.attr) { efree(US.attr); US.attr=NULL; } + if(US.val) { efree(US.val); US.val =NULL; } return NULL; } diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index c1d5803127..0dc03d6bb3 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -39,6 +39,7 @@ #include "ext/xml/php_xml.h" #include "ext/standard/php_incomplete_class.h" #include "ext/standard/base64.h" +#include "ext/standard/info.h" #define WDDX_BUF_LEN 256 #define PHP_CLASS_NAME_VAR "php_class_name" @@ -242,6 +243,7 @@ PHP_MINIT_FUNCTION(wddx) } /* }}} */ + PHP_MINFO_FUNCTION(wddx) { php_info_print_table_start();