Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95417 invoked by uid 1010); 11 Feb 2007 07:49:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95401 invoked from network); 11 Feb 2007 07:49:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2007 07:49:00 -0000 Authentication-Results: pb1.pair.com header.from=slackmase2@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=slackmase2@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.229 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: slackmase2@gmail.com X-Host-Fingerprint: 64.233.162.229 nz-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.162.229] ([64.233.162.229:52706] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/3D-22659-C6ACEC54 for ; Sun, 11 Feb 2007 02:49:00 -0500 Received: by nz-out-0506.google.com with SMTP id k1so1369248nzf for ; Sat, 10 Feb 2007 23:48:58 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=K/3QhaNyn9rkxKBGGPpLRMBl4vhAIz7x6zQNMtcD9P0lhPGEn7WpGGrUXCePUk79DwZl9ulO3QdXMCK2rUy3eQzuHm/rBYqgsWleF2eSkGulyvybszM+xT97YqskEu8TOwKpGTNfKANs3ICBghQ2/94yUj8Qp4kdNYyyrsYZF5g= Received: by 10.114.127.1 with SMTP id z1mr5477436wac.1171180138056; Sat, 10 Feb 2007 23:48:58 -0800 (PST) Received: by 10.115.19.18 with HTTP; Sat, 10 Feb 2007 23:48:58 -0800 (PST) Message-ID: <99cd336d0702102348o10288e12k2d4e795e0f515819@mail.gmail.com> Date: Sun, 11 Feb 2007 18:18:58 +1030 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: filter_var options effect \0 even if it FILTER_FLAG_STRIP_LOW not used? From: slackmase2@gmail.com ("Andy Mason") Hi all, I'm not really sure if this is the correct list to place this on. Apologies if it is not. I've come across some un-expected behaviour in the new filter_var function but i'm not really sure if it's just me not understanding the documentation correctly. I have the following two functions which should filter the HIGH ascii chars and manually strip the LOW ascii chars (so as to allow through \r \n" If the line $input = filter_var( $input, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_AMP | FILTER_NULL_ON_FAILURE); is executed before manually searching for characters like \0 , it appears to effect the ability for mb_strpos to identify low numbered ascii characters. Is the filter_var function automagically removing the \0 ? I'm not saying this is bad in anyway. I can't imagine what you would want/need a null byte for in PHP :) just wanted to check that this is in fact the behaviour that is expected, as I wasn't expecting it from what the docs said. #!/usr/bin/php