? php5.diff.txt
? run-tests.log
? tests/04normal_bof.diff
? tests/04normal_bof.exp
? tests/04normal_bof.log
? tests/04normal_bof.out
? tests/04normal_bof.php
Index: SearchReplace.php
===================================================================
RCS file: /repository/pear/File_SearchReplace/SearchReplace.php,v
retrieving revision 1.15
diff -u -r1.15 SearchReplace.php
--- SearchReplace.php 25 Mar 2007 18:51:59 -0000 1.15
+++ SearchReplace.php 27 Oct 2008 06:34:49 -0000
@@ -261,16 +261,18 @@
$occurences = 0;
$file_array = file($filename);
+ // just for the sake of catching occurences
+ $local_find = array_values((array) $this->find);
+ $local_replace = (is_array($this->replace)) ? array_values($this->replace) : $this->replace;
+
if (empty($this->ignore_lines) && $this->php5) { // PHP5 acceleration
- $file_array = str_replace($this->find, $this->replace, $file_array, $occurences);
+ $file_array = str_replace($local_find, $local_replace, $file_array, $occurences);
} else { // str_replace() doesn't return number of occurences in PHP4
// so we need to count them manually and/or filter strings
$ignore_lines_num = count($this->ignore_lines);
- // just for the sake of catching occurences
- $local_find = array_values((array) $this->find);
- $local_replace = (is_array($this->replace)) ? array_values($this->replace) : $this->replace;
+
for ($i=0; $i < count($file_array); $i++) {