rather then following standard syntax).
Reported by Laurent gaffie. (Ilia)
- Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre)
+- Fixed bug #42785 (json_encode() formats doubles according to locale rather
+ then following standard syntax). (Ilia)
- Fixed bug #42767 (highlight_string() truncates trailing comment). (Ilia)
- Fixed bug #42739 (mkdir() doesn't like a trailing slash when safe_mode is
enabled). (Ilia)
double dbl = Z_DVAL_P(val);
if (!zend_isinf(dbl) && !zend_isnan(dbl)) {
- len = spprintf(&d, 0, "%.*g", (int) EG(precision), dbl);
+ len = spprintf(&d, 0, "%.*k", (int) EG(precision), dbl);
smart_str_appendl(buf, d, len);
efree(d);
} else {
case 'g':
+ case 'k':
case 'G':
case 'H':
switch(modifier) {
lconv = localeconv();
}
#endif
- s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]);
+ s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]);
if (*s == '-') {
prefix_char = *s++;
} else if (print_sign) {
case 'g':
+ case 'k':
case 'G':
case 'H':
switch(modifier) {
lconv = localeconv();
}
#endif
- s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]);
+ s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]);
if (*s == '-')
prefix_char = *s++;
else if (print_sign)