Download & Extend

wrong parameter count for preg_replace()

Project:Dutch Stemmer
Version:master
Component:Code
Category:bug report
Priority:normal
Assigned:clemens.tolboom
Status:reviewed & tested by the community

Issue Summary

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 124

Might be caused by CCK.

Comments

#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

Status:active» reviewed & tested by the community

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

AttachmentSize
dutchstemmer.module 6.03 KB

#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

Version:4.7.x-1.x-dev» master

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.

AttachmentSize
dutchstemmer_preg_replace_php4_safe.patch 3.19 KB

#5

Assigned to:Anonymous» clemens.tolboom

Have to check for D6.

nobody click here