php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4725 preg_replace is not binary save
Submitted: 2000-05-31 13:23 UTC Modified: 2000-06-01 18:35 UTC
From: tom dot anheyer at berlinonline dot de Assigned: andrei (profile)
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 Release OS: Linux 2.2.14 i686 (Redhat 5.2)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom dot anheyer at berlinonline dot de
New email:
PHP Version: OS:

 

 [2000-05-31 13:23 UTC] tom dot anheyer at berlinonline dot de
the following code illustrates the problem:

<?
$str = "\0test\0";
echo "pre preg_replace: " . strlen($str) . "<br>\n";
$str = preg_replace('/test/', 'ok', $str);
echo "post preg_replace: " . strlen($str) . "<br>\n";
?>

./configure --with-apxs=/usr/sbin/apxs --with-gd=/usr 
--with-mysql=/usr --with-config-file-path=/home/httpd/conf
--enable-track-vars --enable-memory-limit --enable-sysvsem
--enable-sysvshm --disable-xml --disable-debug                                   
--enable-inline-optimization

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-31 20:18 UTC] andrei at cvs dot php dot net
Yes, it does have that problem. I plan to work on it in the near future.
 [2000-06-01 18:35 UTC] andrei at cvs dot php dot net
This has been fixed in CVS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC