note 125779 added to function.preg-quote
| From: | Anonymous@php.net | Date: | Fri, 05 Feb 2021 09:34:28 +0000 |
| Subject: | note 125779 added to function.preg-quote | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219257@lists.php.net to get a copy of this message | ||
I discovered that, in addition to escaping the special regular expression characters, preg_quote()
encodes the NUL byte to its octal representation:
<?php
var_dump(preg_quote("\0"));
?>
Output:
string(4) "\000"
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.166 (proxied: 82.123.12.229)
----
Manual Page -- http://php.net/manual/en/function.preg-quote.php
Edit -- https://master.php.net/note/edit/125779
Del: integrated -- https://master.php.net/note/delete/125779/integrated
Del: useless -- https://master.php.net/note/delete/125779/useless
Del: bad code -- https://master.php.net/note/delete/125779/bad+code
Del: spam -- https://master.php.net/note/delete/125779/spam
Del: non-english -- https://master.php.net/note/delete/125779/non-english
Del: in docs -- https://master.php.net/note/delete/125779/in+docs
Del: other reasons-- https://master.php.net/note/delete/125779
Reject -- https://master.php.net/note/reject/125779
Search -- https://master.php.net/manage/user-notes.php