mirror of
https://github.com/php/php-src.git
synced 2025-01-23 04:04:16 +08:00
- Fix warnings
- Fix URL scanner startup crash
This commit is contained in:
parent
ade9a02eef
commit
c45b1c2c8b
@ -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 */
|
||||
|
@ -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 <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
@ -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
|
||||
|
@ -35,22 +35,26 @@
|
||||
#define BUFSIZE 256
|
||||
#endif
|
||||
|
||||
PHP_RINIT_FUNCTION(url_scanner) {
|
||||
url_adapt(NULL,0,NULL,NULL);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_RSHUTDOWN_FUNCTION(url_scanner) {
|
||||
PHP_RINIT_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) {
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user