File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ PHP NEWS
2525- SimpleXML:
2626 . Apply iterator fixes only on master. (nielsdos)
2727
28+ - Standard:
29+ . Fixed str_decrement() on "1". (ilutov)
30+
2831- XSL:
2932 . Fix type error on XSLTProcessor::transformToDoc return value with
3033 SimpleXML. (nielsdos)
Original file line number Diff line number Diff line change @@ -1289,7 +1289,7 @@ PHP_FUNCTION(str_decrement)
12891289 }
12901290 } while (carry && position -- > 0 );
12911291
1292- if (UNEXPECTED (carry || ZSTR_VAL (decremented )[0 ] == '0' )) {
1292+ if (UNEXPECTED (carry || ( ZSTR_VAL (decremented )[0 ] == '0' && ZSTR_LEN ( decremented ) > 1 ) )) {
12931293 if (ZSTR_LEN (decremented ) == 1 ) {
12941294 zend_string_release_ex (decremented , /* persistent */ false);
12951295 zend_argument_value_error (1 , "\"%s\" is out of decrement range" , ZSTR_VAL (str ));
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ $strictlyAlphaNumeric = [
2828 "d " ,
2929 "D " ,
3030 "4 " ,
31+ "1 " ,
3132];
3233
3334foreach ($ strictlyAlphaNumeric as $ s ) {
@@ -77,3 +78,5 @@ string(1) "C"
7778string(1) "D"
7879string(1) "3"
7980string(1) "4"
81+ string(1) "0"
82+ string(1) "1"
You can’t perform that action at this time.
0 commit comments