Bug #69203 [Csd]: FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127

From: Date: Mon, 20 Apr 2015 12:03:57 +0000
Subject: Bug #69203 [Csd]: FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192238@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69203&edit=1 ID: 69203 Updated by: whatthejeff@php.net Reported by: whatthejeff@php.net Summary: FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127 Status: Closed Type: Bug Package: Filter related PHP Version: 5.5Git-2015-03-09 (Git) Assigned To: whatthejeff Block user comment: N Private report: N New Comment: ASCII only encodes 128 characters. I think LOW/HIGH was meant to reference the non-printable characters. Previous Comments: ------------------------------------------------------------------------ [2015-04-20 11:26:02] dominic at mailinator dot com Doesn't FILTER_FLAG_ENCODE_HIGH contain the error here? 127 is lower ASCII. ------------------------------------------------------------------------ [2015-03-14 08:20:49] nikic@php.net Automatic comment on behalf of whatthejeff@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=1e51c5411e2d1bdcddb6731a502ce429605c1d08 Log: Fix #69203: FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127 ------------------------------------------------------------------------ [2015-03-09 11:12:31] whatthejeff@php.net Description: ------------ FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127. This is inconsistent with FILTER_FLAG_ENCODE_HIGH which encodes ASCII 127 as expected. Test script: --------------- // FILTER_FLAG_STRIP_HIGH var_dump(filter_var("\x7f", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)); var_dump(filter_var("\x7f", FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH)); var_dump(filter_var("\x7f", FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH)); var_dump(filter_var("\x7f", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_HIGH)); // FILTER_FLAG_ENCODE_HIGH var_dump(filter_var("\x7f", FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_HIGH)); var_dump(filter_var("\x7f", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_HIGH)); var_dump(filter_var("\x7f", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH)); var_dump(filter_var("\x7f", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH)); Expected result: ---------------- string(0) "" string(0) "" string(0) "" string(0) "" string(6) "" string(6) "" string(3) "%7F" string(6) "" Actual result: -------------- string(1) "" string(1) "" string(3) "%7F" string(1) "" string(6) "" string(6) "" string(3) "%7F" string(6) "" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69203&edit=1

« previous php.bugs (#192238) next »