mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix str_decrement() on "1"
This commit is contained in:
@@ -1289,7 +1289,7 @@ PHP_FUNCTION(str_decrement)
|
||||
}
|
||||
} while (carry && position-- > 0);
|
||||
|
||||
if (UNEXPECTED(carry || ZSTR_VAL(decremented)[0] == '0')) {
|
||||
if (UNEXPECTED(carry || (ZSTR_VAL(decremented)[0] == '0' && ZSTR_LEN(decremented) > 1))) {
|
||||
if (ZSTR_LEN(decremented) == 1) {
|
||||
zend_string_release_ex(decremented, /* persistent */ false);
|
||||
zend_argument_value_error(1, "\"%s\" is out of decrement range", ZSTR_VAL(str));
|
||||
|
||||
@@ -28,6 +28,7 @@ $strictlyAlphaNumeric = [
|
||||
"d",
|
||||
"D",
|
||||
"4",
|
||||
"1",
|
||||
];
|
||||
|
||||
foreach ($strictlyAlphaNumeric as $s) {
|
||||
@@ -77,3 +78,5 @@ string(1) "C"
|
||||
string(1) "D"
|
||||
string(1) "3"
|
||||
string(1) "4"
|
||||
string(1) "0"
|
||||
string(1) "1"
|
||||
|
||||
Reference in New Issue
Block a user