Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.4

Bug #10395 typo in method quickSearch
Submitted: 2007-03-15 17:02 UTC
From: miruoss Assigned: techtonik
Status: Closed Package: File_SearchReplace (version 1.1.1)
PHP Version: 5.2.1 OS: FreeBSD 6.2
Roadmaps: (Not assigned)    
Subscription  


 [2007-03-15 17:02 UTC] miruoss (Michael Ruoss)
Description: ------------ In function quickSearch there is a $file = fread(...) and later: if ($this->php5) { $file_array[$i] = str_replace($this->find, $this->replace, $file_array[$i], $counted); But there is no variable $file_array, there is only $file. It should be: $file = str_replace($this->find, $this->replace, $file, $counted); This means the script doesn't find anything and nothing will be replaced. Test script: --------------- A patch: 335c335 < $file_array[$i] = str_replace($this->find, $this->replace, $file_array[$i], $counted); --- > $file = str_replace($this->find, $this->replace, $file, $counted);

Comments

 [2007-03-19 11:14 UTC] techtonik (anatoly techtonik)
Thanks for report. I've attached patch to the issue and mailed guys with CVS access. Hope it will be applied soon.
 [2007-03-19 11:19 UTC] techtonik (anatoly techtonik)
In the meanwhile could you also run test suite on PHP5? Should be something like: > pear run-tests /path/to/File_SerchReplace/tests
 [2007-03-25 18:39 UTC] techtonik (anatoly techtonik)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. I have troubles with releasing the package on PEAR, but I've uploaded it here http://www.sharebigfile.com/file/121843/File-SearchReplace-1-1-2-tgz.html