Bug #16590 Updated: Problems with strings containing \x00

From: Date: Sat, 13 Apr 2002 20:27:42 +0000
Subject: Bug #16590 Updated: Problems with strings containing \x00
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-4918@lists.php.net to get a copy of this message
ID: 16590 Updated by: jimw@php.net Reported By: daniel@lorch.cc Status: Open -Bug Type: PCRE related +Bug Type: Documentation problem Operating System: Linux PHP Version: 4.1.2 New Comment: pcre is binary safe with regards to the string being matched against, but not the pattern. this is a limitation of the pcre library itself, not just the php interface. you can specify the nul character using: preg_match("/\\x00/", "foo\0bar") reclassified as documentation problem. Previous Comments: ------------------------------------------------------------------------ [2002-04-13 15:59:36] sander@php.net The docs state that PCRE is binary safe. So this might be a bug after all... ------------------------------------------------------------------------ [2002-04-13 13:23:59] daniel@php.net Actually, I'm not sure whether this problem can be solved as it is PCRE and not a PHP specific (and it can't be solved without breaking compatibilty with languages using 0 terminated strings such as C). I'm thinking about making it a documentation problem. What do you guys think? -daniel ------------------------------------------------------------------------ [2002-04-13 13:06:44] daniel@lorch.cc The PCRE has problems with strings containing 0x00. It stops reading as if the strings were \0 terminated. This affects all preg_* functions. Examples: preg_match("/\x00/", "foo"); preg_match("/" . chr(0) . "/", "foo"); Raises the error "Warning: No ending delimiter '/' found" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16590&edit=1

« previous php.bugs (#4918) next »