kjellhahlen wrote:
marckpy2 wrote:
my joomla says in frontpage
"Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/sef.php on line 533"
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/templates/rt_replicant
/rt_moomenu.php on line 149
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/pathway.php on line 313
That is actually another problem, but indeed also related to PHP 5.3. It might belong in a seperate thread.
The fix I provided does fix the errors on your site the original poster mentioned. To fix the "eregi"-error you can do two things:
- The error you are getting is not
really an error, it is a warning to programmers to do not use this function anymore. Although erigi is deprecated your website will function. Most webhosts provide a setting on the control panel to disable error reporting, which should stop warnings like this. Of course this is not really a fix

, and there a better ways! But if you keep getting this message in all kind of places on your website, or you are reluctant to edit php code, it might be a simple way to keep things going.
- The better way: fixing the code. You should edit the files you mentioned, and scroll to the line number the error appears. The keyword eregi should be replaced by preg_match and the syntax should change a bit:
Code:
eregi('SOMESTRING', something, somethingelse);
should become
Code:
preg_match('/SOMESTRING/i', something, somethingelse);
As you can see it is not a big change. Notice that SOMESTRING is beween "/" and "/i" now. All the parameters after that stay the same. I don't know how your php is

, but this of course is the best way by far to fix things.
Look here for more information on the issue:
http://devthought.com/tumble/2009/06/fix-ereg-is-deprecated-errors-in-php-53/If you run into trouble, post the lines of code your error messages mention and I will post back the updated code.
Good luck!
Man, i fix it !!!
i can't believe that i don't need to make the upgrade process to 1.5.
THANKS MAN !!!
but, that fix have a partial solution because, i have others problem with functions like ereg and split that have changed too and replaced with preg_match and explode respectively.
ON THE OTHER HAND, i have a ONE PROBLEM MORE, that i can't find answers on the forum,
this is it:
Deprecated: Assigning the return value of new by reference is deprecated in /home/martastr/public_html/includes/PEAR/PEAR.php on line 563
i look on that code line and appear this:
Code:
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
return $data->getMessage() == $code;
} else {
return $data->getCode() == $code;
}
}
return false;
i don't know what code to change to dissapear this error.
can you help me ? AGAIN ?!!!!!!!!!
