On Fri, 08 Feb 2013 22:09:22 +0100, hakre <hanskren...@yahoo.de> wrote:
----- Ursprüngliche Message -----
Von: Gustavo Lopes <glo...@nebm.ist.utl.pt>
A special case still left is "±0". It is with the 'PLUS-MINUS
SIGN' (U+00B1).
By special case, I meant a deviation to the general rule on how the
code handles the input. The code handles the characters 0-9 prefixed by
an optional sign.
The general rule is to either allow + 'PLUS SIGN' (U+002B) and -
'HYPHEN-MINUS' (U+002D) for all positive natural numbers excluding zero.
The discussion is about to allow those as well for zero.
I was explaining what I meant by "special rule" (read the context), not
describing any concrete implementation. If you fail to see how a general
rule that does not include the (IMO completely unnecessary) zero exclusion
is simpler and therefore a priori preferable, I surely won't be able to
convince you.
The 'PLUS-MINUS SIGN' (U+00B1) is a relevant sign for the number zero in
this context but it got unnoticed so far in the discussion.
[...]
Unicode is never irrelevant, it's used to communicate clearly and
specifically about which signs I'm concerned about.
Unicode does not classify "numeric characters", you probably meant
'Number, Decimal Digit', 'Symbol, Math [Sm]', 'Punctuation, Dash' or
'Number, Other' but it remains unspecified in your email. Would you
please elaborate?
Elaborating is not necessary. The whole issue is irrelevant. This filter
was never meant to handle anything but those ASCII characters. From I can
tell from the docs, the only filters that deal with anything else are
FILTER_SANITIZE_FULL_SPECIAL_CHARS (uses default_charset),
FILTER_SANITIZE_STRING and FILTER_UNSAFE_RAW with ENCODE_HIGH (which seem
to assume ISO-8859-1). Does this mean ext/filter sucks? To a certain
extent.
Otherwise I'd say it's important to document a note that the function is
US-ASCII / ISO-8859-1 safe (only?) as this is string input validation.
Feel free to fix the docs or open a bug report.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php