Skip to content

Commit cd7222d

Browse files
committed
Revert "ext/intl: Fix NumberFormatter parse offset overflow"
This reverts commit 14a7ead.
1 parent 14a7ead commit cd7222d

2 files changed

Lines changed: 3 additions & 59 deletions

File tree

ext/intl/formatter/formatter_parse.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@ U_CFUNC PHP_FUNCTION( numfmt_parse )
5050
}
5151

5252
if (zposition) {
53-
zend_long long_position = zval_get_long(zposition);
54-
if (ZEND_LONG_EXCEEDS_INT(long_position)) {
55-
zend_argument_value_error(hasThis() ? 3 : 4, "must be between %d and %d", INT32_MIN, INT32_MAX);
56-
RETURN_THROWS();
57-
}
58-
position = (int32_t) long_position;
53+
position = (int32_t) zval_get_long(zposition);
5954
}
6055

6156
/* Fetch the object. */
@@ -160,13 +155,8 @@ U_CFUNC PHP_FUNCTION( numfmt_parse_currency )
160155
intl_stringFromChar(ustr, str, str_len, &INTL_DATA_ERROR_CODE(nfo));
161156
INTL_METHOD_CHECK_STATUS( nfo, "String conversion to UTF-16 failed" );
162157

163-
if (zposition) {
164-
zend_long long_position = zval_get_long(zposition);
165-
if (ZEND_LONG_EXCEEDS_INT(long_position)) {
166-
zend_argument_value_error(hasThis() ? 3 : 4, "must be between %d and %d", INT32_MIN, INT32_MAX);
167-
RETURN_THROWS();
168-
}
169-
position = (int32_t) long_position;
158+
if(zposition) {
159+
position = (int32_t) zval_get_long(zposition);
170160
}
171161

172162
icu::ParsePosition pp(position);

ext/intl/tests/formatter_parse_offset_overflow.phpt

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)