File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.5.7
44
5-
5+ - Standard:
6+ . Fixed bug GH-21689 (version_compare() incorrectly handles versions ending
7+ with a dot). (timwolla)
68
7907 May 2026, PHP 8.5.6
810
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ foreach ($special_forms as $f1) {
2222 test ("1.0 $ f1 " , "1.0 $ f2 " );
2323 }
2424}
25+ test ("1.2. " , "1.2. " );
26+ test ("1.2.. " , "1.2.. " );
27+
2528print "TESTING OPERATORS \n" ;
2629foreach ($ special_forms as $ f1 ) {
2730 foreach ($ special_forms as $ f2 ) {
@@ -106,6 +109,8 @@ TESTING COMPARE
1061091.0pl1 > 1.0rc1
1071101.0pl1 > 1.0
1081111.0pl1 = 1.0pl1
112+ 1.2. = 1.2.
113+ 1.2.. = 1.2..
109114TESTING OPERATORS
1101151.0-dev lt 1.0-dev : false
1111161.0-dev < 1.0-dev : false
Original file line number Diff line number Diff line change @@ -68,7 +68,15 @@ php_canonicalize_version(const char *version)
6868 }
6969 lp = * p ++ ;
7070 }
71- * q ++ = '\0' ;
71+
72+ /* Check if the last component is empty (i.e. the last character is a dot)
73+ * and remove it if it is. */
74+ if (* (q - 1 ) == '.' ) {
75+ * (q - 1 ) = '\0' ;
76+ } else {
77+ * q = '\0' ;
78+ }
79+
7280 return buf ;
7381}
7482
You can’t perform that action at this time.
0 commit comments