Browse Source

- Fix a couple of wranings in the FTP code and in parsedate.y

- Be safer with LC_MESSAGES
- Align with the latest Zend change in call_user_function_ex()
PHP-4.0.5
Zeev Suraski 26 years ago
parent
commit
da66298659
  1. 2
      ext/ftp/ftp.c
  2. 2
      ext/ftp/php_ftp.c
  3. 4
      ext/standard/array.c
  4. 4
      ext/standard/basic_functions.c
  5. 8
      ext/standard/parsedate.y
  6. 2
      ext/standard/string.c
  7. 4
      ext/standard/var.c
  8. 4
      ext/wddx/wddx.c

2
ext/ftp/ftp.c

@ -464,7 +464,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
return 0;
for (n=0; n<6; n++)
ipbox.c[n] = b[n];
ipbox.c[n] = (unsigned char) b[n];
memset(&ftp->pasvaddr, 0, sizeof(ftp->pasvaddr));
ftp->pasvaddr.sin_family = AF_INET;

2
ext/ftp/php_ftp.c

@ -151,7 +151,7 @@ PHP_FUNCTION(ftp_connect)
WRONG_PARAM_COUNT;
}
convert_to_long(arg2);
port = arg2->value.lval;
port = (short) arg2->value.lval;
break;
default:
WRONG_PARAM_COUNT;

4
ext/standard/array.c

@ -522,7 +522,7 @@ static int array_user_compare(const void *a, const void *b)
args[0] = (pval **) f->pData;
args[1] = (pval **) s->pData;
if (call_user_function_ex(CG(function_table), NULL, *BG(user_compare_func_name), &retval_ptr, 2, args, 0)==SUCCESS
if (call_user_function_ex(CG(function_table), NULL, *BG(user_compare_func_name), &retval_ptr, 2, args, 0, NULL)==SUCCESS
&& retval_ptr) {
long retval;
@ -976,7 +976,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata)
/* Call the userland function */
if (call_user_function_ex(CG(function_table), NULL, *BG(array_walk_func_name),
&retval_ptr, userdata ? 3 : 2, args, 0) == SUCCESS) {
&retval_ptr, userdata ? 3 : 2, args, 0, NULL) == SUCCESS) {
zval_ptr_dtor(&retval_ptr);
} else

4
ext/standard/basic_functions.c

@ -1413,7 +1413,7 @@ PHP_FUNCTION(call_user_func)
RETURN_FALSE;
}
SEPARATE_ZVAL(params[0]);
if (call_user_function_ex(CG(function_table), NULL, *params[0], &retval_ptr, arg_count-1, params+1, 1)==SUCCESS
if (call_user_function_ex(CG(function_table), NULL, *params[0], &retval_ptr, arg_count-1, params+1, 1, NULL)==SUCCESS
&& retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
@ -1449,7 +1449,7 @@ PHP_FUNCTION(call_user_method)
SEPARATE_ZVAL(params[0]);
SEPARATE_ZVAL(params[1]);
convert_to_string(*params[0]);
if (call_user_function_ex(CG(function_table), *params[1], *params[0], &retval_ptr, arg_count-2, params+2, 1)==SUCCESS
if (call_user_function_ex(CG(function_table), *params[1], *params[0], &retval_ptr, arg_count-2, params+2, 1, NULL)==SUCCESS
&& retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {

8
ext/standard/parsedate.y

@ -452,9 +452,11 @@ o_merid : /* NULL */
time_t get_date (const char *p, const time_t *now);
extern struct tm *gmtime ();
extern struct tm *localtime ();
extern time_t mktime ();
#ifndef PHP_WIN32
extern struct tm *gmtime();
extern struct tm *localtime();
extern time_t mktime();
#endif
/* Month and day table. */
static TABLE const MonthDayTable[] = {

2
ext/standard/string.c

@ -2126,7 +2126,7 @@ PHP_FUNCTION(setlocale)
cat = LC_COLLATE;
else if (!strcasecmp ("LC_CTYPE", category->value.str.val))
cat = LC_CTYPE;
#ifndef PHP_WIN32
#ifdef LC_MESSAGES
else if (!strcasecmp ("LC_MESSAGES", category->value.str.val))
cat = LC_MESSAGES;
#endif

4
ext/standard/var.c

@ -207,7 +207,7 @@ void php_var_serialize(pval *buf, pval **struc)
MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname,"__sleep",1);
res = call_user_function_ex(CG(function_table), *struc, fname, &retval_ptr, 0, 0, 1);
res = call_user_function_ex(CG(function_table), *struc, fname, &retval_ptr, 0, 0, 1, NULL);
if ((res == SUCCESS)) {
if (retval_ptr && HASH_OF(retval_ptr)) {
@ -515,7 +515,7 @@ int php_var_unserialize(pval **rval, const char **p, const char *max)
MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname,"__wakeup",1);
call_user_function_ex(CG(function_table), *rval, fname, &retval_ptr, 0, 0, 1);
call_user_function_ex(CG(function_table), *rval, fname, &retval_ptr, 0, 0, 1, NULL);
zval_dtor(fname);
FREE_ZVAL(fname);

4
ext/wddx/wddx.c

@ -396,7 +396,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
* We try to call __sleep() method on object. It's supposed to return an
* array of property names to be serialized.
*/
if (call_user_function_ex(CG(function_table), obj, fname, &retval, 0, 0, 1) == SUCCESS) {
if (call_user_function_ex(CG(function_table), obj, fname, &retval, 0, 0, 1, NULL) == SUCCESS) {
if (retval && HASH_OF(retval)) {
php_wddx_add_chunk_static(packet, WDDX_STRUCT_S);
sprintf(tmp_buf, WDDX_VAR_S, PHP_CLASS_NAME_VAR);
@ -750,7 +750,7 @@ static void php_wddx_pop_element(void *user_data, const char *name)
MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname, "__wakeup", 1);
call_user_function_ex(NULL, obj, fname, &retval, 0, 0, 0);
call_user_function_ex(NULL, obj, fname, &retval, 0, 0, 0, NULL);
zval_dtor(fname);
FREE_ZVAL(fname);

Loading…
Cancel
Save