serialize() should use '.' as decimal point irrespectively to locale

This commit is contained in:
Antony Dovgal 2006-12-19 12:36:44 +00:00
parent c43fc2afc8
commit 0ecaeb89d3

View File

@ -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;
}