This great module show me an error with php 5.3 and Pressflow when I upload a file.
When this cropped up in Drupal Core (#360605: PHP 5.3 Compatibility), the core team came to the conclusion that since 6.x is no longer the "active" Drupal version, and support for it will likely be dropped long before PHP actually removes this function, the best resolution is simply to suppress the error message.
This is easy enough - just go to line 734 of filefield.module and add a '@' immediately before the ereg_replace function.
<?php $regex = '/\.('. @ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';?>
Attached is a patch that will do this for you.
Thanks for the fix.
I agree with the approach, and the fix works of course, but the patch doesn't apply. Here's one that does.
was this patch commited, I found myself in the same situation today when clearing errors in db log..
No it hasn't been committed. Drupal 6 itself doesn't run real great on PHP 5.3+, but this should be applied in any case. FileField isn't receiving regular updates but I'll include this one in the next version when I go through the queue.
I would prefer we update the function call to something which isn't deprecated, rather than just hiding the error.
Patch attached which contains a switch to using preg_replace().
It's a simple change, but let me know if it needs work.
Apologies, that patch probably won't apply in it's current state purely due to the file location.
I'll try and create an appropriate one using the normal Drupal git method.
Ok, so, more hast less speed.
Attached is a normal Drupal project patch file.
We can't change the API on developers at this point in the release and there's not signifant reason to make a 4.x release just for this purpose.
Oops sorry. The patch in #3 really should still be committed.
Agreed. I only submitted the patch as I finally felt compelled to fix it after having the message continually appear, and thought i'd provide a patch back.
Patch #3 looks good, but as it's nearly a year and hasn't been committed I wonder whether it hadn't been accepted/committed due to it continuing with the deprecated function instead of updating to the PHP recommended replacement. Hence the alternate patch.
Whilst I don't agree with the approach of hiding the deprecated functions rather than updating to the supported language alternative functions, this does sadly appear to be Drupal way, and as such patch #3 would be good. I overlooked that there are still occurrences of ereg_replace hidden away in D6 core. (and maybe other deprecated functions, I haven't looked in detail)
Anyway, thanks, if #3 could be committed that would be great.
Sorry to bump this issue thread after all this time.
No worries, it's my bad for not having committed this already. I've largely stopped doing any D6-only development work; which has in turn let FileField languish because I no longer have any D6 sites. I'll go through the queue and get all these RTBC patches at some point. RTBC for #3.
Committed #3. Sorry for the delay on this guys. I'll try to get a new release out this week.
Automatically closed -- issue fixed for 2 weeks with no activity.
Drupal is a registered trademark of Dries Buytaert.