Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:2532 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94296 invoked from network); 22 Jun 2003 13:08:15 -0000 Received: from unknown (HELO tabini.ca) (198.63.211.18) by pb1.pair.com with SMTP; 22 Jun 2003 13:08:15 -0000 Received: from cpe0050ba4130cb-cm013439900542.cpe.net.cable.rogers.com ([24.156.157.246] helo=mbe) by tabini.ca with asmtp (TLSv1:RC4-MD5:128) (Exim 4.20) id 19U4YH-0001l8-9m for internals@lists.php.net; Sun, 22 Jun 2003 08:06:37 -0500 To: internals@lists.php.net Content-Type: text/plain Organization: Marco Tabini & Associates, Inc. Message-ID: <1056287234.3325.38.camel@mbe> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 22 Jun 2003 09:07:15 -0400 Content-Transfer-Encoding: 7bit Subject: Bug #24281 From: marcot@tabini.ca (Marco Tabini) I stumbled upon bug #24281 while running a few test on the current HEAD for PHP5--it seems to me that it should be sufficient to change a single line of code to make str_replace() work as expected, but I'm not familiar enough with the internals to know whether my fix is good or not...so, here it is. It seems to work for my test case, and for the test case reported in the bug. Cheers, Marco Index: string.c =================================================================== RCS file: /repository/php4/ext/standard/string.c,v retrieving revision 1.391 diff -u -r1.391 string.c --- string.c 20 Jun 2003 15:41:43 -0000 1.391 +++ string.c 22 Jun 2003 13:06:51 -0000 @@ -3194,7 +3194,7 @@ php_str_replace_in_subject(*search, *replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL); } if (argc > 3) { - Z_LVAL_PP(zcount) = count; + ZVAL_LONG(*zcount, count); } } /* }}} */