com php-src: Z_STRLEN vs Z_STRSIZE in ext/intl: ext/intl/breakiterator/breakiterator_iterators.cpp ext
/intl/breakiterator/rulebasedbreakiterator_methods.cpp ex t/intl/collator/collator_convert.c ext/intl/collator/coll ator_sort.c
ext/intl/common/common_date.cpp ext/int l/converter/converter.c ext/intl/dateformat/dateformat_at trcpp.cpp
ext/intl/dateformat/dateformat_format_object .cpp ext/intl/intl_common.h ext/intl/locale/locale_ methods.c ext/intl/ms
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 10:14:20 +0000 |
| Subject: | com php-src: Z_STRLEN vs Z_STRSIZE in ext/intl: ext/intl/breakiterator/breakiterator_iterators.cpp ext /intl/breakiterator/rulebasedbreakiterator_methods.cpp ex t/intl/collator/collator_convert.c ext/intl/collator/coll ator_sort.c ext/intl/common/common_date.cpp ext/int l/converter/converter.c ext/intl/dateformat/dateformat_at trcpp.cpp ext/intl/dateformat/dateformat_format_object .cpp ext/intl/intl_common.h ext/intl/locale/locale_ methods.c ext/intl/ms |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73454@lists.php.net to get a copy of this message | ||
Commit: 05593baf9ac50429bb4b5a0edbfca18e64e33820
Author: Anatol Belski <ab@php.net> Sat, 24 Aug 2013 07:02:28 -0700
Parents: 457f28c3544dd80639123d380034db14cd613300
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=05593baf9ac50429bb4b5a0edbfca18e64e33820
Log:
Z_STRLEN vs Z_STRSIZE in ext/intl
Changed paths:
M ext/intl/breakiterator/breakiterator_iterators..cpp
M ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
M ext/intl/collator/collator_convert.c
M ext/intl/collator/collator_sort.c
M ext/intl/common/common_date.cpp
M ext/intl/converter/converter.c
M ext/intl/dateformat/dateformat_attrcpp.cpp
M ext/intl/dateformat/dateformat_format_object.cpp
M ext/intl/intl_common.h
M ext/intl/locale/locale_methods.c
M ext/intl/msgformat/msgformat_helpers.cpp
M ext/intl/timezone/timezone_class.cpp
M ext/intl/timezone/timezone_methods.cpp
M ext/intl/transliterator/transliterator_class.c
M ext/intl/transliterator/transliterator_methods.c
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 3748991..da1afb2 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -173,7 +173,7 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_ * No need to do anything, the engine increments ->index */ const char *s = Z_STRVAL_P(bio->text); - int32_t slen = Z_STRLEN_P(bio->text), + int32_t slen = Z_STRSIZE_P(bio->text), len; char *res; diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 993a1a2..722ac38 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -123,7 +123,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) Z_TYPE_P(return_value) = IS_STRING; if (intl_charFromString(rules, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), BREAKITER_ERROR_CODE_P(bio)) == FAILURE) + &Z_STRSIZE_P(return_value), BREAKITER_ERROR_CODE_P(bio)) == FAILURE) { intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio), "rbbi_hash_code: Error converting result to UTF-8 string", diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 2a3ac10..0ab2a2f 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -59,7 +59,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16( return; old_val = Z_STRVAL_P( *hashData ); - old_val_len = Z_STRLEN_P( *hashData ); + old_val_len = Z_STRSIZE_P( *hashData ); /* Convert it from UTF-8 to UTF-16LE and save the result to new_val[_len]. */ intl_convert_utf8_to_utf16( &new_val, &new_val_len, old_val, old_val_len, status ); @@ -103,7 +103,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( return; old_val = Z_STRVAL_P( *hashData ); - old_val_len = Z_STRLEN_P( *hashData ); + old_val_len = Z_STRSIZE_P( *hashData ); /* Convert it from UTF-16LE to UTF-8 and save the result to new_val[_len]. */ intl_convert_utf16_to_utf8( &new_val, &new_val_len, @@ -196,7 +196,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval ) /* Convert to utf8 then. */ intl_convert_utf16_to_utf8( &str, &str_len, - (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRLEN_P(utf16_zval) ), &status ); + (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRSIZE_P(utf16_zval) ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error converting utf16 to utf8 in collator_convert_zval_utf16_to_utf8()" ); @@ -225,7 +225,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( utf8_zval ), Z_STRLEN_P( utf8_zval ), + Z_STRVAL_P( utf8_zval ), Z_STRSIZE_P( utf8_zval ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_zstr_utf8_to_utf16()" ); @@ -298,7 +298,7 @@ zval* collator_convert_object_to_string( zval* obj TSRMLS_DC ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( zstr ), Z_STRLEN_P( zstr ), + Z_STRVAL_P( zstr ), Z_STRSIZE_P( zstr ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_object_to_string()" ); @@ -382,7 +382,7 @@ zval* collator_convert_string_to_number_if_possible( zval* str ) COLLATOR_CONVERT_RETURN_FAILED( str ); } - if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) ) + if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRSIZE_P(str) ), &lval, &dval, 1 ) ) ) { ALLOC_INIT_ZVAL( num ); diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 4fda638..9a273a6 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -84,8 +84,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 /* Compare the strings using ICU. */ result->value.lval = ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1), INTL_Z_STRLEN_P(str1), - INTL_Z_STRVAL_P(str2), INTL_Z_STRLEN_P(str2) ); + INTL_Z_STRVAL_P(str1), INTL_Z_STRSIZE_P(str1), + INTL_Z_STRVAL_P(str2), INTL_Z_STRSIZE_P(str2) ); result->type = IS_LONG; } else @@ -193,8 +193,8 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM /* Compare the strings using ICU. */ result->value.lval = ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1), INTL_Z_STRLEN_P(str1), - INTL_Z_STRVAL_P(str2), INTL_Z_STRLEN_P(str2) ); + INTL_Z_STRVAL_P(str1), INTL_Z_STRSIZE_P(str1), + INTL_Z_STRVAL_P(str2), INTL_Z_STRSIZE_P(str2) ); result->type = IS_LONG; zval_ptr_dtor( &str1 ); @@ -428,7 +428,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) /* Process string values only. */ if( Z_TYPE_PP( hashData ) == IS_STRING ) { - intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_PP( hashData ), Z_STRLEN_PP( hashData ), COLLATOR_ERROR_CODE_P( co ) ); + intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_PP( hashData ), Z_STRSIZE_PP( hashData ), COLLATOR_ERROR_CODE_P( co ) ); if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) { diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index ee99881..0d277e6 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -186,7 +186,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS switch (Z_TYPE_P(z)) { case IS_STRING: - type = is_numeric_string(Z_STRVAL_P(z), Z_STRLEN_P(z), &lv, &rv, 0); + type = is_numeric_string(Z_STRVAL_P(z), Z_STRSIZE_P(z), &lv, &rv, 0); if (type == IS_DOUBLE) { rv *= U_MILLIS_PER_SECOND; } else if (type == IS_LONG) { diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 5dbfede..286ebab 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -177,7 +177,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode case IS_STRING: { const char *strval = Z_STRVAL_P(val); - int i = 0, strlen = Z_STRLEN_P(val); + int i = 0, strlen = Z_STRSIZE_P(val); while((i != strlen) && TARGET_CHECK(args, 1)) { UChar c; @@ -271,7 +271,7 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni return; case IS_STRING: { - int vallen = Z_STRLEN_P(val); + int vallen = Z_STRSIZE_P(val); if (TARGET_CHECK(args, vallen)) { memcpy(args->target, Z_STRVAL_P(val), vallen); args->target += vallen; @@ -828,13 +828,13 @@ static PHP_METHOD(UConverter, transcode) { zend_hash_find(Z_ARRVAL_P(options), "from_subst", sizeof("from_subst"), (void**)&tmpzval) == SUCCESS && Z_TYPE_PP(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(src_cnv, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(src_cnv, Z_STRVAL_PP(tmpzval), Z_STRSIZE_PP(tmpzval) & 0x7F, &error); } if (U_SUCCESS(error) && zend_hash_find(Z_ARRVAL_P(options), "to_subst", sizeof("to_subst"), (void**)&tmpzval) == SUCCESS && Z_TYPE_PP(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(dest_cnv, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(dest_cnv, Z_STRVAL_PP(tmpzval), Z_STRSIZE_PP(tmpzval) & 0x7F, &error); } } diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index b68abec..319e4f33 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -58,7 +58,7 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id) UnicodeString res = UnicodeString(); fetch_datefmt(dfo)->getTimeZone().getID(res); intl_charFromString(res, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), &INTL_DATA_ERROR_CODE(dfo)); + &Z_STRSIZE_P(return_value), &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS(dfo, "Could not convert time zone id to UTF-8"); Z_TYPE_P(return_value) = IS_STRING; diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index 91c93eb..f3f74c8 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -124,7 +124,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_PP(format); } else { convert_to_string_ex(format); - if (Z_STRLEN_PP(format) == 0) { + if (Z_STRSIZE_PP(format) == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: the format is empty", 0 TSRMLS_CC); RETURN_FALSE; @@ -176,7 +176,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (pattern) { df = new SimpleDateFormat( - UnicodeString(Z_STRVAL_PP(format), Z_STRLEN_PP(format), + UnicodeString(Z_STRVAL_PP(format), Z_STRSIZE_PP(format), UnicodeString::kInvariant), Locale::createFromName(locale_str), status); @@ -213,7 +213,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) Z_TYPE_P(return_value) = IS_STRING; if (intl_charFromString(result, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), &status) == FAILURE) { + &Z_STRSIZE_P(return_value), &status) == FAILURE) { intl_error_set(NULL, status, "datefmt_format_object: error converting result to UTF-8", 0 TSRMLS_CC); diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index 9424571..cf83e6d 100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h @@ -39,6 +39,6 @@ #define UCHARS(len) ((len) / sizeof(UChar)) #define INTL_Z_STRVAL_P(str) (UChar*) Z_STRVAL_P(str) -#define INTL_Z_STRLEN_P(str) UCHARS( Z_STRLEN_P(str) ) +#define INTL_Z_STRSIZE_P(str) UCHARS( Z_STRSIZE_P(str) ) #endif /* INTL_COMMON_H */ diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index d1a86d8..48398cd 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -762,7 +762,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_ /* not lang or grandfathered tag */ smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); } - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); return SUCCESS; } @@ -802,7 +802,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix( loc_name , key_name); smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); return SUCCESS; } else if(Z_TYPE_PP(ele_value) == IS_ARRAY ) { HashPosition pos; @@ -818,7 +818,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(data) , Z_STRLEN_PP(data)); + smart_str_appendl(loc_name, Z_STRVAL_PP(data) , Z_STRSIZE_PP(data)); zend_hash_move_forward_ex(arr, &pos); } return SUCCESS; @@ -852,7 +852,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , cur_key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); } } /* end of for */ } /* end of else */ @@ -1429,7 +1429,7 @@ static char* lookup_loc_range(char* loc_range, HashTable* hash_arr, int canonica intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC); LOOKUP_CLEAN_RETURN(NULL); } - cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_PP(ele_value), Z_STRLEN_PP(ele_value)); + cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_PP(ele_value), Z_STRSIZE_PP(ele_value)); result = strToMatch(Z_STRVAL_PP(ele_value), cur_arr[cur_arr_len*2]); if(result == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC); diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c4456d5..ad855e3 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -454,7 +454,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), &err.code); + Z_STRVAL_PP(elem), Z_STRSIZE_PP(elem), &err.code); if (U_FAILURE(err.code)) { char *message; diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 374b163..1618839 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -90,7 +90,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, } else { /* Call the constructor! */ Z_TYPE(arg) = IS_STRING; - if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRLEN(arg), + if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRSIZE(arg), &INTL_ERROR_CODE(*outside_error)) == FAILURE) { spprintf(&message, 0, "%s: could not convert id to UTF-8", func); intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error), @@ -179,7 +179,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval **zv_timezone, gottenId; UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */ convert_to_string_ex(zv_timezone); - if (intl_stringFromChar(id, Z_STRVAL_PP(zv_timezone), Z_STRLEN_PP(zv_timezone), + if (intl_stringFromChar(id, Z_STRVAL_PP(zv_timezone), Z_STRSIZE_PP(zv_timezone), &status) == FAILURE) { spprintf(&message, 0, "%s: Time zone identifier given is not a " "valid UTF-8 string", func); diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 9ca6b44..44a089b 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -177,7 +177,7 @@ double_offset: long lval; double dval; convert_to_string_ex(arg); - switch (is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &lval, &dval, 0)) { + switch (is_numeric_string(Z_STRVAL_PP(arg), Z_STRSIZE_PP(arg), &lval, &dval, 0)) { case IS_DOUBLE: SEPARATE_ZVAL(arg); zval_dtor(*arg); @@ -317,7 +317,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) TimeZone::getCanonicalID(id, result, isSystemID, status); INTL_CHECK_STATUS(status, "intltz_get_canonical_id: error obtaining canonical ID"); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), &status); INTL_CHECK_STATUS(status, "intltz_get_canonical_id: could not convert time zone id to UTF-16"); @@ -401,7 +401,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) } const UnicodeString result = TimeZone::getEquivalentID(id, (int32_t)index); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), &status); INTL_CHECK_STATUS(status, "intltz_get_equivalent_id: " "could not convert resulting time zone id to UTF-16"); @@ -569,7 +569,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) to->utimezone->getDisplayName((UBool)daylight, (TimeZone::EDisplayType)display_type, Locale::createFromName(locale_str), result); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), TIMEZONE_ERROR_CODE_P(to)); INTL_METHOD_CHECK_STATUS(to, "intltz_get_display_name: " "could not convert resulting time zone id to UTF-16"); diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 9891b35..f666efc 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -256,7 +256,7 @@ static zval **Transliterator_get_property_ptr_ptr( zval *object, zval *member, i TRANSLITERATOR_PROPERTY_HANDLER_PROLOG; if(zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) { retval = NULL; /* fallback to read_property */ } @@ -289,7 +289,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type, if( ( type != BP_VAR_R && type != BP_VAR_IS ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); retval = &EG( uninitialized_zval ); @@ -322,7 +322,7 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val if( ( EG( scope ) != Transliterator_ce_ptr ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); } diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index 1aa39c5..f8e13f1 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -340,7 +340,7 @@ PHP_FUNCTION( transliterator_transliterate ) } ALLOC_INIT_ZVAL( object ); temp_trans = 1; - res = create_transliterator( Z_STRVAL_PP( arg1 ), Z_STRLEN_PP( arg1 ), + res = create_transliterator( Z_STRVAL_PP( arg1 ), Z_STRSIZE_PP( arg1 ), TRANSLITERATOR_FORWARD, object TSRMLS_CC ); if( res == FAILURE ) {
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 3748991..da1afb2 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -173,7 +173,7 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_ * No need to do anything, the engine increments ->index */ const char *s = Z_STRVAL_P(bio->text); - int32_t slen = Z_STRLEN_P(bio->text), + int32_t slen = Z_STRSIZE_P(bio->text), len; char *res; diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 993a1a2..722ac38 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -123,7 +123,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) Z_TYPE_P(return_value) = IS_STRING; if (intl_charFromString(rules, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), BREAKITER_ERROR_CODE_P(bio)) == FAILURE) + &Z_STRSIZE_P(return_value), BREAKITER_ERROR_CODE_P(bio)) == FAILURE) { intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio), "rbbi_hash_code: Error converting result to UTF-8 string", diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 2a3ac10..0ab2a2f 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -59,7 +59,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16( return; old_val = Z_STRVAL_P( *hashData ); - old_val_len = Z_STRLEN_P( *hashData ); + old_val_len = Z_STRSIZE_P( *hashData ); /* Convert it from UTF-8 to UTF-16LE and save the result to new_val[_len]. */ intl_convert_utf8_to_utf16( &new_val, &new_val_len, old_val, old_val_len, status ); @@ -103,7 +103,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( return; old_val = Z_STRVAL_P( *hashData ); - old_val_len = Z_STRLEN_P( *hashData ); + old_val_len = Z_STRSIZE_P( *hashData ); /* Convert it from UTF-16LE to UTF-8 and save the result to new_val[_len]. */ intl_convert_utf16_to_utf8( &new_val, &new_val_len, @@ -196,7 +196,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval ) /* Convert to utf8 then. */ intl_convert_utf16_to_utf8( &str, &str_len, - (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRLEN_P(utf16_zval) ), &status ); + (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRSIZE_P(utf16_zval) ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error converting utf16 to utf8 in collator_convert_zval_utf16_to_utf8()" ); @@ -225,7 +225,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( utf8_zval ), Z_STRLEN_P( utf8_zval ), + Z_STRVAL_P( utf8_zval ), Z_STRSIZE_P( utf8_zval ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_zstr_utf8_to_utf16()" ); @@ -298,7 +298,7 @@ zval* collator_convert_object_to_string( zval* obj TSRMLS_DC ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( zstr ), Z_STRLEN_P( zstr ), + Z_STRVAL_P( zstr ), Z_STRSIZE_P( zstr ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_object_to_string()" ); @@ -382,7 +382,7 @@ zval* collator_convert_string_to_number_if_possible( zval* str ) COLLATOR_CONVERT_RETURN_FAILED( str ); } - if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) ) + if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRSIZE_P(str) ), &lval, &dval, 1 ) ) ) { ALLOC_INIT_ZVAL( num ); diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 4fda638..9a273a6 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -84,8 +84,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 /* Compare the strings using ICU. */ result->value.lval = ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1), INTL_Z_STRLEN_P(str1), - INTL_Z_STRVAL_P(str2), INTL_Z_STRLEN_P(str2) ); + INTL_Z_STRVAL_P(str1), INTL_Z_STRSIZE_P(str1), + INTL_Z_STRVAL_P(str2), INTL_Z_STRSIZE_P(str2) ); result->type = IS_LONG; } else @@ -193,8 +193,8 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM /* Compare the strings using ICU. */ result->value.lval = ucol_strcoll( co->ucoll, - INTL_Z_STRVAL_P(str1), INTL_Z_STRLEN_P(str1), - INTL_Z_STRVAL_P(str2), INTL_Z_STRLEN_P(str2) ); + INTL_Z_STRVAL_P(str1), INTL_Z_STRSIZE_P(str1), + INTL_Z_STRVAL_P(str2), INTL_Z_STRSIZE_P(str2) ); result->type = IS_LONG; zval_ptr_dtor( &str1 ); @@ -428,7 +428,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) /* Process string values only. */ if( Z_TYPE_PP( hashData ) == IS_STRING ) { - intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_PP( hashData ), Z_STRLEN_PP( hashData ), COLLATOR_ERROR_CODE_P( co ) ); + intl_convert_utf8_to_utf16( &utf16_buf, &utf16_len, Z_STRVAL_PP( hashData ), Z_STRSIZE_PP( hashData ), COLLATOR_ERROR_CODE_P( co ) ); if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) { diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index ee99881..0d277e6 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -186,7 +186,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS switch (Z_TYPE_P(z)) { case IS_STRING: - type = is_numeric_string(Z_STRVAL_P(z), Z_STRLEN_P(z), &lv, &rv, 0); + type = is_numeric_string(Z_STRVAL_P(z), Z_STRSIZE_P(z), &lv, &rv, 0); if (type == IS_DOUBLE) { rv *= U_MILLIS_PER_SECOND; } else if (type == IS_LONG) { diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 5dbfede..286ebab 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -177,7 +177,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode case IS_STRING: { const char *strval = Z_STRVAL_P(val); - int i = 0, strlen = Z_STRLEN_P(val); + int i = 0, strlen = Z_STRSIZE_P(val); while((i != strlen) && TARGET_CHECK(args, 1)) { UChar c; @@ -271,7 +271,7 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni return; case IS_STRING: { - int vallen = Z_STRLEN_P(val); + int vallen = Z_STRSIZE_P(val); if (TARGET_CHECK(args, vallen)) { memcpy(args->target, Z_STRVAL_P(val), vallen); args->target += vallen; @@ -828,13 +828,13 @@ static PHP_METHOD(UConverter, transcode) { zend_hash_find(Z_ARRVAL_P(options), "from_subst", sizeof("from_subst"), (void**)&tmpzval) == SUCCESS && Z_TYPE_PP(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(src_cnv, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(src_cnv, Z_STRVAL_PP(tmpzval), Z_STRSIZE_PP(tmpzval) & 0x7F, &error); } if (U_SUCCESS(error) && zend_hash_find(Z_ARRVAL_P(options), "to_subst", sizeof("to_subst"), (void**)&tmpzval) == SUCCESS && Z_TYPE_PP(tmpzval) == IS_STRING) { error = U_ZERO_ERROR; - ucnv_setSubstChars(dest_cnv, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval) & 0x7F, &error); + ucnv_setSubstChars(dest_cnv, Z_STRVAL_PP(tmpzval), Z_STRSIZE_PP(tmpzval) & 0x7F, &error); } } diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index b68abec..319e4f33 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -58,7 +58,7 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id) UnicodeString res = UnicodeString(); fetch_datefmt(dfo)->getTimeZone().getID(res); intl_charFromString(res, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), &INTL_DATA_ERROR_CODE(dfo)); + &Z_STRSIZE_P(return_value), &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS(dfo, "Could not convert time zone id to UTF-8"); Z_TYPE_P(return_value) = IS_STRING; diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index 91c93eb..f3f74c8 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -124,7 +124,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_PP(format); } else { convert_to_string_ex(format); - if (Z_STRLEN_PP(format) == 0) { + if (Z_STRSIZE_PP(format) == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format_object: the format is empty", 0 TSRMLS_CC); RETURN_FALSE; @@ -176,7 +176,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) if (pattern) { df = new SimpleDateFormat( - UnicodeString(Z_STRVAL_PP(format), Z_STRLEN_PP(format), + UnicodeString(Z_STRVAL_PP(format), Z_STRSIZE_PP(format), UnicodeString::kInvariant), Locale::createFromName(locale_str), status); @@ -213,7 +213,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) Z_TYPE_P(return_value) = IS_STRING; if (intl_charFromString(result, &Z_STRVAL_P(return_value), - &Z_STRLEN_P(return_value), &status) == FAILURE) { + &Z_STRSIZE_P(return_value), &status) == FAILURE) { intl_error_set(NULL, status, "datefmt_format_object: error converting result to UTF-8", 0 TSRMLS_CC); diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index 9424571..cf83e6d 100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h @@ -39,6 +39,6 @@ #define UCHARS(len) ((len) / sizeof(UChar)) #define INTL_Z_STRVAL_P(str) (UChar*) Z_STRVAL_P(str) -#define INTL_Z_STRLEN_P(str) UCHARS( Z_STRLEN_P(str) ) +#define INTL_Z_STRSIZE_P(str) UCHARS( Z_STRSIZE_P(str) ) #endif /* INTL_COMMON_H */ diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index d1a86d8..48398cd 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -762,7 +762,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_ /* not lang or grandfathered tag */ smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); } - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); return SUCCESS; } @@ -802,7 +802,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix( loc_name , key_name); smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); return SUCCESS; } else if(Z_TYPE_PP(ele_value) == IS_ARRAY ) { HashPosition pos; @@ -818,7 +818,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(data) , Z_STRLEN_PP(data)); + smart_str_appendl(loc_name, Z_STRVAL_PP(data) , Z_STRSIZE_PP(data)); zend_hash_move_forward_ex(arr, &pos); } return SUCCESS; @@ -852,7 +852,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, add_prefix(loc_name , cur_key_name); } smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); - smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value)); + smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRSIZE_PP(ele_value)); } } /* end of for */ } /* end of else */ @@ -1429,7 +1429,7 @@ static char* lookup_loc_range(char* loc_range, HashTable* hash_arr, int canonica intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC); LOOKUP_CLEAN_RETURN(NULL); } - cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_PP(ele_value), Z_STRLEN_PP(ele_value)); + cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_PP(ele_value), Z_STRSIZE_PP(ele_value)); result = strToMatch(Z_STRVAL_PP(ele_value), cur_arr[cur_arr_len*2]); if(result == 0) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC); diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c4456d5..ad855e3 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -454,7 +454,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), &err.code); + Z_STRVAL_PP(elem), Z_STRSIZE_PP(elem), &err.code); if (U_FAILURE(err.code)) { char *message; diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 374b163..1618839 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -90,7 +90,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, } else { /* Call the constructor! */ Z_TYPE(arg) = IS_STRING; - if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRLEN(arg), + if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRSIZE(arg), &INTL_ERROR_CODE(*outside_error)) == FAILURE) { spprintf(&message, 0, "%s: could not convert id to UTF-8", func); intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error), @@ -179,7 +179,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval **zv_timezone, gottenId; UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */ convert_to_string_ex(zv_timezone); - if (intl_stringFromChar(id, Z_STRVAL_PP(zv_timezone), Z_STRLEN_PP(zv_timezone), + if (intl_stringFromChar(id, Z_STRVAL_PP(zv_timezone), Z_STRSIZE_PP(zv_timezone), &status) == FAILURE) { spprintf(&message, 0, "%s: Time zone identifier given is not a " "valid UTF-8 string", func); diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 9ca6b44..44a089b 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -177,7 +177,7 @@ double_offset: long lval; double dval; convert_to_string_ex(arg); - switch (is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &lval, &dval, 0)) { + switch (is_numeric_string(Z_STRVAL_PP(arg), Z_STRSIZE_PP(arg), &lval, &dval, 0)) { case IS_DOUBLE: SEPARATE_ZVAL(arg); zval_dtor(*arg); @@ -317,7 +317,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) TimeZone::getCanonicalID(id, result, isSystemID, status); INTL_CHECK_STATUS(status, "intltz_get_canonical_id: error obtaining canonical ID"); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), &status); INTL_CHECK_STATUS(status, "intltz_get_canonical_id: could not convert time zone id to UTF-16"); @@ -401,7 +401,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) } const UnicodeString result = TimeZone::getEquivalentID(id, (int32_t)index); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), &status); INTL_CHECK_STATUS(status, "intltz_get_equivalent_id: " "could not convert resulting time zone id to UTF-16"); @@ -569,7 +569,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) to->utimezone->getDisplayName((UBool)daylight, (TimeZone::EDisplayType)display_type, Locale::createFromName(locale_str), result); - intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), + intl_convert_utf16_to_utf8(&Z_STRVAL_P(return_value), &Z_STRSIZE_P(return_value), result.getBuffer(), result.length(), TIMEZONE_ERROR_CODE_P(to)); INTL_METHOD_CHECK_STATUS(to, "intltz_get_display_name: " "could not convert resulting time zone id to UTF-16"); diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 9891b35..f666efc 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -256,7 +256,7 @@ static zval **Transliterator_get_property_ptr_ptr( zval *object, zval *member, i TRANSLITERATOR_PROPERTY_HANDLER_PROLOG; if(zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) { retval = NULL; /* fallback to read_property */ } @@ -289,7 +289,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type, if( ( type != BP_VAR_R && type != BP_VAR_IS ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); retval = &EG( uninitialized_zval ); @@ -322,7 +322,7 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val if( ( EG( scope ) != Transliterator_ce_ptr ) && ( zend_binary_strcmp( "id", sizeof( "id" ) - 1, - Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) ) + Z_STRVAL_P( member ), Z_STRSIZE_P( member ) ) == 0 ) ) { php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" ); } diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index 1aa39c5..f8e13f1 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -340,7 +340,7 @@ PHP_FUNCTION( transliterator_transliterate ) } ALLOC_INIT_ZVAL( object ); temp_trans = 1; - res = create_transliterator( Z_STRVAL_PP( arg1 ), Z_STRLEN_PP( arg1 ), + res = create_transliterator( Z_STRVAL_PP( arg1 ), Z_STRSIZE_PP( arg1 ), TRANSLITERATOR_FORWARD, object TSRMLS_CC ); if( res == FAILURE ) {