Bug #16180: ereg_replace() a chr() doesn't work
| From: | marcel at daxy dot net | Date: | Wed, 20 Mar 2002 11:04:06 +0000 |
| Subject: | Bug #16180: ereg_replace() a chr() doesn't work | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-2941@lists.php.net to get a copy of this message | ||
From: marcel@daxy.net
Operating system: Linux
PHP version: 4.1.2
PHP Bug Type: Regexps related
Bug description: ereg_replace() a chr() doesn't work
Version: php-3.0.18
<?
$string = "line 1" . chr(10) . "line 2";
$string = ereg_replace(chr(10),"<BR>",$string);
echo $string;
?>
This display's "line 1<BR>" in the source.
This has been fixed in PHP4 and in the Debian php3-package, however not in
the source of PHP3. The folowing patch solves the problem (Submited in
news://debian.bugs.dist on 2001-09-10 by Daniel Crettol):
/* Begin patch */
diff -Naur php3-3.0.18/regex/regex.h php3-3.0.18.new/regex/regex.h
--- php3-3.0.18/regex/regex.h Fri Nov 12 21:57:49 1999
+++ php3-3.0.18.new/regex/regex.h Mon Sep 10 22:08:24 2001
@@ -12,7 +12,7 @@
#define API_EXPORT(type) type
#endif
-typedef off_t regoff_t;
+typedef int regoff_t;
typedef struct {
int re_magic;
size_t re_nsub; /* number of parenthesized subexpressions
*/
/* End patch */
I don't want to take credit for this patch, but just want it to be
reported/fixed ;)
--
Edit bug report at http://bugs.php.net/?id=16180&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16180&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16180&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16180&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16180&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16180&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16180&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16180&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16180&r=submittedtwice