mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
serialize() should use '.' as decimal point irrespectively to locale
This commit is contained in:
parent
c43fc2afc8
commit
0ecaeb89d3
@ -689,10 +689,12 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var
|
||||
|
||||
case IS_DOUBLE: {
|
||||
char *s;
|
||||
ulong slen;
|
||||
|
||||
slen = spprintf(&s, 0, "d:%.*G;", (int) PG(serialize_precision), Z_DVAL_P(struc));
|
||||
smart_str_appendl(buf, s, slen);
|
||||
smart_str_appendl(buf, "d:", 2);
|
||||
s = (char *) emalloc(MAX_LENGTH_OF_DOUBLE + PG(serialize_precision) + 1);
|
||||
php_gcvt(Z_DVAL_P(struc), PG(serialize_precision), '.', 'E', s);
|
||||
smart_str_appends(buf, s);
|
||||
smart_str_appendc(buf, ';');
|
||||
efree(s);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user