]> granicus.if.org Git - php/commit
Implement #51368: php_filter_float does not allow custom thousand separators
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Mar 2018 12:04:44 +0000 (13:04 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 24 Mar 2018 14:04:32 +0000 (15:04 +0100)
commitaed1e358dc8e1727bb996703b09c5f6d25e9719d
tree8ea1c949abda6f248230eec388ff1d6ce8d2ed7d
parent9a3bb1201fdfbac2dbc61062e80eabb0674dbb21
Implement #51368: php_filter_float does not allow custom thousand separators

A set of hard-coded thousand separator characters (presently, `',.`) is
somewhat limited (users may prefer other separators, such as spaces or
underscores), as well as somewhat too liberal (arbitrary combinations
of different thousand separators are presently possible).  Therefore we
introduce a `thousand` option analogous to `decimal`, which allows to
define the desired thousand separators as non-empty string, defaulting
to `',.`.  While we easily could support empty strings here as well,
that would not make much sense, since this behavior can more easily be
accomplished by not setting the `FILTER_FLAG_ALLOW_THOUSAND` flag in
the first place.
UPGRADING
ext/filter/logical_filters.c
ext/filter/tests/bug51368.phpt [new file with mode: 0644]