Login Retreive lost passwordRegister
Search

Forum Index / Feedback / deprecated functions: ereg() ereg_replace()

[ This topic is solved ]

  Recmo D. 15 August 09 / 14:50  
As some of my pages gave errors after upgrading PHP about some functions where deprecated I noticed also FH uses these functions.

Just wanted to let you know this for a next version.

 Quote
 
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.


I didn't dig in it too deep but I replaced ereg() for preg_match() and ereg_replace() for preg_replace(). Solved my problems..

  Johan Wiegel (Admin) 17 August 09 / 08:52  
Thanks will be altered in todays release

  Recmo D. 19 August 09 / 12:22  
Warning(!)
My workarounds were just to point out to the problem. Not the complete just ctrl-c ctrl-v is the sollution... I said I didn't dig in too far..
preg_match and ereg are not the same and you should investigate what should be done to make the change of functions work correctly.
I noticed you changed some code where eregi also should work (case insensitive). Nice...
Now to be clear: The following is just one example... not all !!
Look at: fields/class.UploadField.php (#525)

This line gave a warning: if(preg_match('^image/', $sType) &&
Because simply change ereg for preg_match is not enough.

I read on http://nl2.php.net/manual/en/function.preg-match.php I see there are slashes around the pattern.
So I chaned it to this if(preg_match('/^image\//', $sType) &&

I'm not a 100% sure because I'm not in to it too deep.
I hope this helps you... Sorry if I was not completely clear about it last week.

Remco

  Johan Wiegel (Admin) 19 August 09 / 12:32  
Thought i tested al my changes, will look into it

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license