wrong parameter count for preg_replace()
Bèr Kessels - July 16, 2006 - 23:05
| Project: | Dutch Stemmer |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | clemens.tolboom |
| Status: | reviewed & tested by the community |
Description
wrong parameter count for preg_replace() on cron run.
Warning: Wrong parameter count for preg_replace() in ***/modules/dutchstemmer/dutchstemmer.module on line 108
Warning: Wrong parameter count for preg_replace() in ***/modules/dutchstemmer/dutchstemmer.module on line 124Might be caused by CCK.

#1
Wrong parameter count for preg_replace() in /home/tit.nl/public_html/modules/dutchstemmer/dutchstemmer.module op lijn 112.
Wrong parameter count for preg_replace() in /home/tit.nl/public_html/modules/dutchstemmer/dutchstemmer.module op lijn 124.
Definetly not by CCK. I didn't install that. Maybe search404? That module also created some of these errors.
Cron.php made a few pages....
Otherwise excellent module that gives my site some badly needed search results!
Thanks!
#2
Solved!
Sorry, I'm no good at patching, so I committed the changed module.
Seems Preg_replace got an optional extra variable in PHP5. It was parsed in the function but nowhere declared, so I just cut it out. The module seems to be working now for PHP4 too.
http://cn2.php.net/manual/en/function.preg-replace.php
#3
Had the same problem while searching for "evenwichtig"
Installed the new module file supplied by splash112 and it worked...
the remloval of the php5 param has fixed it for php4...
a better solution would be to check the php version prior to adding or removing that parameter...
#4
Here is a patch.
The $count parameter was used all over the place, yet never referenced to. Not only ugly and messy codewise, but it apparently breaks in PHP4. This patch fixes that.
#5
Have to check for D6.