| Author |
Message |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Sun Aug 09, 2009 6:35 am |
|
Using WampServer 2.0
Recieved this error during install, after clicking "save settings"
(http://localhost/raven/INSTALLATION/setup.php)
| Code: | Deprecated: Function eregi_replace() is deprecated in C:\wamp\www\raven\INSTALLATION\setup.php on line 311
Deprecated: Function eregi_replace() is deprecated in C:\wamp\www\raven\INSTALLATION\setup.php on line 325 |
Navigated to the index page (http://localhost/raven/index.php) to load with the following error:
| Code: | | Deprecated: Function eregi() is deprecated in C:\wamp\www\raven\modules\Your_Account\includes\mainfileend.php on line 17 |
Could it be a PHP extension? |
Last edited by mantasledge on Sun Aug 09, 2009 6:39 pm; edited 1 time in total |
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2402 Location: Pennsylvania
|
Posted:
Sun Aug 09, 2009 8:45 am |
|
What version of php are you using? |
|
|
|
 |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Sun Aug 09, 2009 4:33 pm |
|
PHP: 5.3.0
I am using the latest version of Wamp.
The only PHP setting I have changed is to turned on "magic quotes gpc". it was recommended for RN install. |
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2402 Location: Pennsylvania
|
Posted:
Sun Aug 09, 2009 4:42 pm |
|
Look in rnconfig.php for $error_reporting = E_ALL^E_NOTICE; (around line 82) and change it to this $error_reporting = E_ALL^E_NOTICE^E_DEPRECATED; |
|
|
|
 |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Sun Aug 09, 2009 6:40 pm |
|
Thanks Pablin! That fixed it  |
|
|
|
 |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Mon Aug 10, 2009 12:27 am |
|
Seems to be PHP5.3
Found another fix
modules\Your_Account\includes\mainfileend.php on line 17
FROM:
| Code: | if (eregi('mainfileend.php', $_SERVER['SCRIPT_NAME'])) {
header('Location: ../../../index.php');
die();
} |
TO:
| Code: | if (preg_match('/constants.php/i', $_SERVER['SCRIPT_NAME'])) {
Header('Location: index.php');
die();
} |
modules\Your_Account\includes\constants.php on line 17
FROM:
| Code: | if (eregi('mainfileend.php', $_SERVER['SCRIPT_NAME'])) {
header('Location: ../../../index.php');
die();
} |
TO:
| Code: | if (preg_match('/constants.php/i', $_SERVER['SCRIPT_NAME'])) {
Header('Location: index.php');
die();
} |
Works with that |
Last edited by mantasledge on Tue Aug 11, 2009 4:49 pm; edited 1 time in total |
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9070 Location: Arizona
|
Posted:
Tue Aug 11, 2009 6:54 am |
|
mantasledge, I have opened an Issue for our team for future release consideration to make the switch from the ereg library to PCRE. Thanks for bringing this to our attention! |
|
|
|
 |
jakec Site Admin

Joined: Feb 06, 2006 Posts: 3028 Location: United Kingdom
|
Posted:
Tue Aug 11, 2009 10:37 am |
|
I'm assuming that the filenames are round the wrong way in the above code. |
|
|
|
 |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Tue Aug 11, 2009 4:55 pm |
|
you assumed correctly
Should read:
modules\Your_Account\includes\mainfileend.php on line 17
FROM:
| Code: | if (eregi('mainfileend.php', $_SERVER['SCRIPT_NAME'])) {
header('Location: ../../../index.php');
die();
} |
TO:
| Code: | if (preg_match('/mainfileend.php/i', $_SERVER['SCRIPT_NAME'])) {
Header('Location: index.php');
die();
} |
modules\Your_Account\includes\constants.php on line 17
FROM:
| Code: | if (eregi('constants.php', $_SERVER['SCRIPT_NAME'])) {
header('Location: ../../../index.php');
die();
} |
TO:
| Code: | if (preg_match('/constants.php/i', $_SERVER['SCRIPT_NAME'])) {
Header('Location: index.php');
die();
} |
Works with that |
|
|
|
 |
redroest New Member


Joined: Dec 15, 2008 Posts: 2
|
Posted:
Wed Aug 19, 2009 5:04 am |
|
Hey people, I got the same error on my website. The problem is that I have like 40 of these messages from multiple modules.
Is there a way to change my server to make it work with ereg()? I am running wamp 5 |
|
|
|
 |
fkelly Moderator

Joined: Aug 30, 2005 Posts: 3135 Location: near Albany NY
|
Posted:
Wed Aug 19, 2009 8:54 am |
|
Redroest you need to suppress the ^E_DEPRECATED warnings as mentioned in a previous post in this thread. Ereg and eregi are functions that are used throughout *Nuke. At one time they were perfectly fine, now the PHP gods have decided to deprecate them. Eventually they won't be supported at all. Over time the RN team will replace them with supported functions but that won't be until at least the next release after the upcoming 2.4. |
|
|
|
 |
redroest New Member


Joined: Dec 15, 2008 Posts: 2
|
Posted:
Wed Aug 19, 2009 9:36 am |
|
Ok, and when I change these scripts manualy and give them to you as a download, are you people going to use it then? |
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2402 Location: Pennsylvania
|
Posted:
Wed Aug 19, 2009 11:35 am |
|
If you would like to send the files to a staff member that would be fine, but since we are in the process of finalizing 2.4 I am not sure they will make it into that.
It is perfectly fine to just hide the depreciation warnings. Everything will work fine it is just a warning that when php is upgraded (ie PHP 6) it will be a problem. |
Last edited by Palbin on Sat Aug 22, 2009 9:02 am; edited 1 time in total |
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9070 Location: Arizona
|
Posted:
Sat Aug 22, 2009 8:38 am |
|
mantasledge, I would also just do what Palbin has suggested. These are just warnings and while we have cleaned up literally 10,000 + of these, PHP continues to progress and things change. We'll take care of this in the 2.50.00 release most likely (as 2.40.00 is close to finalization and in code freeze). |
|
|
|
 |
mantasledge New Member


Joined: Oct 25, 2008 Posts: 12
|
Posted:
Sat Aug 22, 2009 7:58 pm |
|
Agreed
My host isn't planning on running PHP5.3 any time soon, only the testing server I have on my box has PHP5.3.
Thanks again guys, great help |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Thu Jan 07, 2010 11:10 am |
|
First of all, Happy New to all of you
Please correct me if this is the right way
Get rid of deprecated function
Is this correct?
Deprecated
| Code: | if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
header("Location: ../../../index.php");
die ();
} |
Replace with
| Code: | if (preg_match("/modules.php/i", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
} |
I will add more of example in order to see if I am correct. Thanks in advance. I hope you've had a nice Christmas and nice party at the end of the year. |
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2402 Location: Pennsylvania
|
Posted:
Thu Jan 07, 2010 11:32 am |
|
I believe that to be correct.  |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Thu Jan 07, 2010 11:59 am |
|
Thanks for the fast reply Palbin but there is something not clear with this issue
In modules
I got this
deprecated
| Code: | if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
} |
Should I replace with this one
| Code: | if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
} |
or
with this one
| Code: | if (preg_match("/modules.php/i", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
} |
I cant write more the scroll is irritating me going up |
Last edited by unicornio on Thu Jan 07, 2010 12:06 pm; edited 1 time in total |
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Thu Jan 07, 2010 12:05 pm |
|
In blocks I have this
| Code: | if (eregi("block-Sample_Block.php",$PHP_SELF)) {
Header("Location: index.php");
die();} |
Replace with
| Code: | if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
} |
but I got this
| Code: | if (stristr($_SERVER['PHP_SELF'], "block-Example.php")) {
Header("Location: ../index.php");
die();
} |
Is this code above deprecated from blocks. Can I replace it with
| Code: | if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
} |
I am a little confused but I am sure I will be clear soon if you explain a little bit more with details. Thanks again. |
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2402 Location: Pennsylvania
|
Posted:
Thu Jan 07, 2010 1:37 pm |
|
Yes, where you can you should be using the defined constants in modules and blocks, BLOCK_FILE and MODULE_FILE |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Thu Jan 07, 2010 3:02 pm |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Sun Jan 10, 2010 11:56 am |
|
Deprecated
| Code: | if (eregi("getrss.php", $_SERVER['PHP_SELF'])) {
Header("Location: http://www.google.com/search?hl=en&q=define%3A+stupid&btnG=Google+Search");
die();
} |
Replace with
| Code: | if (preg_match('/getrss.php/i', $_SERVER['SCRIPT_NAME'])) {
Header("Location: http://www.google.com/search?hl=en&q=define%3A+stupid&btnG=Google+Search");
die();
} |
|
Last edited by unicornio on Tue Apr 27, 2010 7:05 am; edited 2 times in total |
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Sun Jan 10, 2010 1:47 pm |
|
Is this correct?
deprecated
| Code: | | if (ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) { |
Replace with
| Code: | | if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) { |
|
Last edited by unicornio on Tue Apr 27, 2010 7:04 am; edited 1 time in total |
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9070 Location: Arizona
|
Posted:
Mon Jan 11, 2010 6:31 pm |
|
In this last one, you are replacing a case sensitive check with a case INsensitive one. Just wanted to make sure you knew that and that it was an intended change. |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Thu Jan 21, 2010 2:59 am |
|
Hi Montego.
I tried to deprecate this one but I got this error.
preg_split(): No ending delimiter ',' found
Deprecated
| Code: | | $user_group_list_cp = split(",", $USER_DATA['user_group_list_cp']); |
Can you post here the solution?
and this one too
| Code: | | if (eregi($BadNickList[$i], $username)) $stop = "<center>"._NAMERESTRICTED."</center><br>"; |
should I replace it with this one
| Code: | | if (preg_match($BadNickList[$i], $username)) $stop = "<center>"._NAMERESTRICTED."</center><br>"; |
|
Last edited by unicornio on Mon May 10, 2010 4:57 pm; edited 2 times in total |
|
|
 |
|
|
|
|