php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26524 eregi_replace and backslash
Submitted: 2003-12-04 10:18 UTC Modified: 2003-12-04 10:21 UTC
From: boccara at netvision dot net dot il Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.3 OS: win2k server sp4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: boccara at netvision dot net dot il
New email:
PHP Version: OS:

 

 [2003-12-04 10:18 UTC] boccara at netvision dot net dot il
Description:
------------
the eregi_replace seems to have a problem with replacing backslach.
I made a function that should replace a \ with \\
and I got this error message:
<b>Warning</b>:  eregi_replace(): REG_EESCAPE:Ptrailing backslash (\) in ....

Reproduce code:
---------------
function JavascriptEncode($str1)
{
	$str1 = eregi_replace(chr(92),chr(92).chr(92),$str1);
	return $str1;
}
this fonction doesn't work.

function JavascriptEncode($str1)
{
	$str1 = eregi_replace(chr(92).chr(92),chr(92).chr(92),$str1);
	return $str1;
}
this fonction replace \ by \\ ( it works, but why ???)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-04 10:21 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC