#50309 [NEW]: Add plain-text sanitizing to filter
From: marcus at synchromedia dot co dot uk
Operating system:
PHP version: 5.3.1
PHP Bug Type: Feature/Change Request
Bug description: Add plain-text sanitizing to filter
Description:
------------
While the FILTER_FLAG_STRIP_LOW and FILTER_FLAG_STRIP_HIGH flags used
with FILTER_SANITIZE_STRING work fine, They are just a bit blunt to be
useful in practice. A more normal application would be to remove any
'funny' characters from plain text, so for example to allow chars 9, 10,
13, 32-126. This could be called FILTER_FLAG_PLAIN_TEXT. While this
could be done using regex, it's probably the most common use case, so
deserves a dedicated filter flag. This could be flipped around and be
called FILTER_FLAG_ALLOW_WHITESPACE, overriding STRIP_LOW to allow chars
9, 10, 13 through.
Similarly, a very common need is to normalize line breaks to \n, \r\n or
\r.
--
Edit bug report at http://bugs.php.net/?id=50309&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50309&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50309&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50309&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50309&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50309&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50309&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50309&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50309&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50309&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50309&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50309&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50309&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50309&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50309&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50309&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50309&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50309&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50309&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50309&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50309&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50309&r=mysqlcfg
Thread (2 messages)
- marcus at synchromedia dot co dot uk