Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN New Installation Issues
Author Message
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Sun Aug 09, 2009 6:35 am Reply with quote

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 
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun Aug 09, 2009 8:45 am Reply with quote

What version of php are you using?

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
mantasledge
PostPosted: Sun Aug 09, 2009 4:33 pm Reply with quote

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
PostPosted: Sun Aug 09, 2009 4:42 pm Reply with quote

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
PostPosted: Sun Aug 09, 2009 6:40 pm Reply with quote

Thanks Pablin! That fixed it Wink
 
mantasledge
PostPosted: Mon Aug 10, 2009 12:27 am Reply with quote

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
Site Admin


Joined: Aug 29, 2004
Posts: 9451
Location: Arizona

PostPosted: Tue Aug 11, 2009 6:54 am Reply with quote

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!

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Tue Aug 11, 2009 10:37 am Reply with quote

I'm assuming that the filenames are round the wrong way in the above code.
 
View user's profile Send private message
mantasledge
PostPosted: Tue Aug 11, 2009 4:55 pm Reply with quote

you assumed correctly Wink

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
New Member


Joined: Dec 15, 2008
Posts: 2

PostPosted: Wed Aug 19, 2009 5:04 am Reply with quote

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
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Wed Aug 19, 2009 8:54 am Reply with quote

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.
 
View user's profile Send private message Visit poster's website
redroest
PostPosted: Wed Aug 19, 2009 9:36 am Reply with quote

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
PostPosted: Wed Aug 19, 2009 11:35 am Reply with quote

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
PostPosted: Sat Aug 22, 2009 8:38 am Reply with quote

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
PostPosted: Sat Aug 22, 2009 7:58 pm Reply with quote

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
 
hicuxunicorniobestbuildpc
Life Cycles Becoming CPU Cycles


Joined: Aug 13, 2009
Posts: 967
Location: Netherland

PostPosted: Thu Jan 07, 2010 11:10 am Reply with quote

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.
 
View user's profile Send private message Visit poster's website
Palbin
PostPosted: Thu Jan 07, 2010 11:32 am Reply with quote

I believe that to be correct. Wink
 
hicuxunicorniobestbuildpc
PostPosted: Thu Jan 07, 2010 11:59 am Reply with quote

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 hicuxunicorniobestbuildpc on Thu Jan 07, 2010 12:06 pm; edited 1 time in total 
hicuxunicorniobestbuildpc
PostPosted: Thu Jan 07, 2010 12:05 pm Reply with quote

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
PostPosted: Thu Jan 07, 2010 1:37 pm Reply with quote

Yes, where you can you should be using the defined constants in modules and blocks, BLOCK_FILE and MODULE_FILE
 
hicuxunicorniobestbuildpc
PostPosted: Thu Jan 07, 2010 3:02 pm Reply with quote

Thanks a lot.
 
hicuxunicorniobestbuildpc
PostPosted: Sun Jan 10, 2010 11:56 am Reply with quote

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 hicuxunicorniobestbuildpc on Tue Apr 27, 2010 7:05 am; edited 2 times in total 
hicuxunicorniobestbuildpc
PostPosted: Sun Jan 10, 2010 1:47 pm Reply with quote

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 hicuxunicorniobestbuildpc on Tue Apr 27, 2010 7:04 am; edited 1 time in total 
montego
PostPosted: Mon Jan 11, 2010 6:31 pm Reply with quote

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.
 
hicuxunicorniobestbuildpc
PostPosted: Thu Jan 21, 2010 2:59 am Reply with quote

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 hicuxunicorniobestbuildpc on Mon May 10, 2010 4:57 pm; edited 2 times in total 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN New Installation Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©