@@ -266,7 +266,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, zend_str_size_int *p
266
266
if (Z_OBJ_HANDLER_P (* arg , cast_object )(* arg , obj , type TSRMLS_CC ) == SUCCESS ) {
267
267
zval_ptr_dtor (arg );
268
268
* arg = obj ;
269
- * pl = Z_STRLEN_PP (arg );
269
+ * pl = Z_STRSIZE_PP (arg );
270
270
* p = Z_STRVAL_PP (arg );
271
271
return SUCCESS ;
272
272
}
@@ -276,7 +276,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, zend_str_size_int *p
276
276
if (Z_OBJ_HT_PP (arg ) == & std_object_handlers || !Z_OBJ_HANDLER_PP (arg , cast_object )) {
277
277
SEPARATE_ZVAL_IF_NOT_REF (arg );
278
278
if (zend_std_cast_object_tostring (* arg , * arg , type TSRMLS_CC ) == SUCCESS ) {
279
- * pl = Z_STRLEN_PP (arg );
279
+ * pl = Z_STRSIZE_PP (arg );
280
280
* p = Z_STRVAL_PP (arg );
281
281
return SUCCESS ;
282
282
}
@@ -292,7 +292,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, zend_str_size_int *p
292
292
if (!use_copy ) {
293
293
ZVAL_ZVAL (* arg , z , 1 , 1 );
294
294
}
295
- * pl = Z_STRLEN_PP (arg );
295
+ * pl = Z_STRSIZE_PP (arg );
296
296
* p = Z_STRVAL_PP (arg );
297
297
return SUCCESS ;
298
298
}
@@ -337,7 +337,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con
337
337
double d ;
338
338
int type ;
339
339
340
- if ((type = is_numeric_string (Z_STRVAL_PP (arg ), Z_STRLEN_PP (arg ), p , & d , -1 )) == 0 ) {
340
+ if ((type = is_numeric_string (Z_STRVAL_PP (arg ), Z_STRSIZE_PP (arg ), p , & d , -1 )) == 0 ) {
341
341
return "long" ;
342
342
} else if (type == IS_DOUBLE ) {
343
343
if (c == 'L' ) {
@@ -396,7 +396,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con
396
396
long l ;
397
397
int type ;
398
398
399
- if ((type = is_numeric_string (Z_STRVAL_PP (arg ), Z_STRLEN_PP (arg ), & l , p , -1 )) == 0 ) {
399
+ if ((type = is_numeric_string (Z_STRVAL_PP (arg ), Z_STRSIZE_PP (arg ), & l , p , -1 )) == 0 ) {
400
400
return "double" ;
401
401
} else if (type == IS_LONG ) {
402
402
* p = (double ) l ;
@@ -458,7 +458,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con
458
458
SEPARATE_ZVAL (arg );
459
459
}
460
460
* p = Z_STRVAL_PP (arg );
461
- pl = Z_STRLEN_PP (arg );
461
+ pl = Z_STRSIZE_PP (arg );
462
462
if ((c == 'p' || c == 'P' ) && CHECK_ZVAL_NULL_PATH (* arg )) {
463
463
return "a valid path" ;
464
464
}
@@ -610,7 +610,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con
610
610
break ;
611
611
}
612
612
convert_to_string_ex (arg );
613
- if (zend_lookup_class (Z_STRVAL_PP (arg ), Z_STRLEN_PP (arg ), & lookup TSRMLS_CC ) == FAILURE ) {
613
+ if (zend_lookup_class (Z_STRVAL_PP (arg ), Z_STRSIZE_PP (arg ), & lookup TSRMLS_CC ) == FAILURE ) {
614
614
* pce = NULL ;
615
615
} else {
616
616
* pce = * lookup ;
@@ -1560,7 +1560,7 @@ ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
1560
1560
1561
1561
switch (Z_TYPE_P (key )) {
1562
1562
case IS_STRING :
1563
- result = zend_symtable_update (ht , Z_STRVAL_P (key ), Z_STRLEN_P (key ) + 1 , & value , sizeof (zval * ), NULL );
1563
+ result = zend_symtable_update (ht , Z_STRVAL_P (key ), Z_STRSIZE_P (key ) + 1 , & value , sizeof (zval * ), NULL );
1564
1564
break ;
1565
1565
case IS_NULL :
1566
1566
result = zend_symtable_update (ht , "" , 1 , & value , sizeof (zval * ), NULL );
@@ -2773,10 +2773,10 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
2773
2773
if (!ce_org ) {
2774
2774
/* Skip leading \ */
2775
2775
if (Z_STRVAL_P (callable )[0 ] == '\\' ) {
2776
- mlen = Z_STRLEN_P (callable ) - 1 ;
2776
+ mlen = Z_STRSIZE_P (callable ) - 1 ;
2777
2777
lmname = zend_str_tolower_dup (Z_STRVAL_P (callable ) + 1 , mlen );
2778
2778
} else {
2779
- mlen = Z_STRLEN_P (callable );
2779
+ mlen = Z_STRSIZE_P (callable );
2780
2780
lmname = zend_str_tolower_dup (Z_STRVAL_P (callable ), mlen );
2781
2781
}
2782
2782
/* Check if function with given name exists.
@@ -2789,13 +2789,13 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
2789
2789
}
2790
2790
2791
2791
/* Split name into class/namespace and method/function names */
2792
- if ((colon = zend_memrchr (Z_STRVAL_P (callable ), ':' , Z_STRLEN_P (callable ))) != NULL &&
2792
+ if ((colon = zend_memrchr (Z_STRVAL_P (callable ), ':' , Z_STRSIZE_P (callable ))) != NULL &&
2793
2793
colon > Z_STRVAL_P (callable ) &&
2794
2794
* (colon - 1 ) == ':'
2795
2795
) {
2796
2796
colon -- ;
2797
2797
clen = colon - Z_STRVAL_P (callable );
2798
- mlen = Z_STRLEN_P (callable ) - clen - 2 ;
2798
+ mlen = Z_STRSIZE_P (callable ) - clen - 2 ;
2799
2799
2800
2800
if (colon == Z_STRVAL_P (callable )) {
2801
2801
if (error ) zend_spprintf (error , 0 , "invalid function name" );
@@ -2823,7 +2823,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
2823
2823
mname = Z_STRVAL_P (callable ) + clen + 2 ;
2824
2824
} else if (ce_org ) {
2825
2825
/* Try to fetch find static method of given class. */
2826
- mlen = Z_STRLEN_P (callable );
2826
+ mlen = Z_STRSIZE_P (callable );
2827
2827
mname = Z_STRVAL_P (callable );
2828
2828
ftable = & ce_org -> function_table ;
2829
2829
fcc -> calling_scope = ce_org ;
@@ -3056,17 +3056,17 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
3056
3056
if (callable_name ) {
3057
3057
char * ptr ;
3058
3058
3059
- * callable_name_len = fcc -> calling_scope -> name_length + Z_STRLEN_P (callable ) + sizeof ("::" ) - 1 ;
3059
+ * callable_name_len = fcc -> calling_scope -> name_length + Z_STRSIZE_P (callable ) + sizeof ("::" ) - 1 ;
3060
3060
ptr = * callable_name = emalloc (* callable_name_len + 1 );
3061
3061
memcpy (ptr , fcc -> calling_scope -> name , fcc -> calling_scope -> name_length );
3062
3062
ptr += fcc -> calling_scope -> name_length ;
3063
3063
memcpy (ptr , "::" , sizeof ("::" ) - 1 );
3064
3064
ptr += sizeof ("::" ) - 1 ;
3065
- memcpy (ptr , Z_STRVAL_P (callable ), Z_STRLEN_P (callable ) + 1 );
3065
+ memcpy (ptr , Z_STRVAL_P (callable ), Z_STRSIZE_P (callable ) + 1 );
3066
3066
}
3067
3067
} else if (callable_name ) {
3068
- * callable_name = estrndup (Z_STRVAL_P (callable ), Z_STRLEN_P (callable ));
3069
- * callable_name_len = Z_STRLEN_P (callable );
3068
+ * callable_name = estrndup (Z_STRVAL_P (callable ), Z_STRSIZE_P (callable ));
3069
+ * callable_name_len = Z_STRSIZE_P (callable );
3070
3070
}
3071
3071
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY ) {
3072
3072
fcc -> called_scope = fcc -> calling_scope ;
@@ -3106,20 +3106,20 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
3106
3106
if (callable_name ) {
3107
3107
char * ptr ;
3108
3108
3109
- * callable_name_len = Z_STRLEN_PP (obj ) + Z_STRLEN_PP (method ) + sizeof ("::" ) - 1 ;
3109
+ * callable_name_len = Z_STRSIZE_PP (obj ) + Z_STRSIZE_PP (method ) + sizeof ("::" ) - 1 ;
3110
3110
ptr = * callable_name = emalloc (* callable_name_len + 1 );
3111
- memcpy (ptr , Z_STRVAL_PP (obj ), Z_STRLEN_PP (obj ));
3112
- ptr += Z_STRLEN_PP (obj );
3111
+ memcpy (ptr , Z_STRVAL_PP (obj ), Z_STRSIZE_PP (obj ));
3112
+ ptr += Z_STRSIZE_PP (obj );
3113
3113
memcpy (ptr , "::" , sizeof ("::" ) - 1 );
3114
3114
ptr += sizeof ("::" ) - 1 ;
3115
- memcpy (ptr , Z_STRVAL_PP (method ), Z_STRLEN_PP (method ) + 1 );
3115
+ memcpy (ptr , Z_STRVAL_PP (method ), Z_STRSIZE_PP (method ) + 1 );
3116
3116
}
3117
3117
3118
3118
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY ) {
3119
3119
return 1 ;
3120
3120
}
3121
3121
3122
- if (!zend_is_callable_check_class (Z_STRVAL_PP (obj ), Z_STRLEN_PP (obj ), fcc , & strict_class , error TSRMLS_CC )) {
3122
+ if (!zend_is_callable_check_class (Z_STRVAL_PP (obj ), Z_STRSIZE_PP (obj ), fcc , & strict_class , error TSRMLS_CC )) {
3123
3123
return 0 ;
3124
3124
}
3125
3125
@@ -3136,13 +3136,13 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
3136
3136
if (callable_name ) {
3137
3137
char * ptr ;
3138
3138
3139
- * callable_name_len = fcc -> calling_scope -> name_length + Z_STRLEN_PP (method ) + sizeof ("::" ) - 1 ;
3139
+ * callable_name_len = fcc -> calling_scope -> name_length + Z_STRSIZE_PP (method ) + sizeof ("::" ) - 1 ;
3140
3140
ptr = * callable_name = emalloc (* callable_name_len + 1 );
3141
3141
memcpy (ptr , fcc -> calling_scope -> name , fcc -> calling_scope -> name_length );
3142
3142
ptr += fcc -> calling_scope -> name_length ;
3143
3143
memcpy (ptr , "::" , sizeof ("::" ) - 1 );
3144
3144
ptr += sizeof ("::" ) - 1 ;
3145
- memcpy (ptr , Z_STRVAL_PP (method ), Z_STRLEN_PP (method ) + 1 );
3145
+ memcpy (ptr , Z_STRVAL_PP (method ), Z_STRSIZE_PP (method ) + 1 );
3146
3146
}
3147
3147
3148
3148
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY ) {
@@ -3204,8 +3204,8 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
3204
3204
int use_copy ;
3205
3205
3206
3206
zend_make_printable_zval (callable , & expr_copy , & use_copy );
3207
- * callable_name = estrndup (Z_STRVAL (expr_copy ), Z_STRLEN (expr_copy ));
3208
- * callable_name_len = Z_STRLEN (expr_copy );
3207
+ * callable_name = estrndup (Z_STRVAL (expr_copy ), Z_STRSIZE (expr_copy ));
3208
+ * callable_name_len = Z_STRSIZE (expr_copy );
3209
3209
zval_dtor (& expr_copy );
3210
3210
}
3211
3211
if (error ) zend_spprintf (error , 0 , "no array or string given" );
0 commit comments