PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

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

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: 2402
Location: Pennsylvania

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

What version of php are you using?
View user's profile Send private message Visit poster's website
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Sun Aug 09, 2009 4:33 pm Reply with quote Back to top

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


Joined: Mar 30, 2006
Posts: 2402
Location: Pennsylvania

PostPosted: Sun Aug 09, 2009 4:42 pm Reply with quote Back to top

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;
View user's profile Send private message Visit poster's website
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Sun Aug 09, 2009 6:40 pm Reply with quote Back to top

Thanks Pablin! That fixed it Wink
View user's profile Send private message
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Mon Aug 10, 2009 12:27 am Reply with quote Back to top

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


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

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

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!
View user's profile Send private message Visit poster's website
jakec
Site Admin


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

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

I'm assuming that the filenames are round the wrong way in the above code.
View user's profile Send private message
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Tue Aug 11, 2009 4:55 pm Reply with quote Back to top

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
View user's profile Send private message
redroest
New Member
New Member


Joined: Dec 15, 2008
Posts: 2

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

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
Moderator


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

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

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


Joined: Dec 15, 2008
Posts: 2

PostPosted: Wed Aug 19, 2009 9:36 am Reply with quote Back to top

Ok, and when I change these scripts manualy and give them to you as a download, are you people going to use it then?
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2402
Location: Pennsylvania

PostPosted: Wed Aug 19, 2009 11:35 am Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
montego
Former Admin in Good Standing


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

PostPosted: Sat Aug 22, 2009 8:38 am Reply with quote Back to top

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).
View user's profile Send private message Visit poster's website
mantasledge
New Member
New Member


Joined: Oct 25, 2008
Posts: 12

PostPosted: Sat Aug 22, 2009 7:58 pm Reply with quote Back to top

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
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

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

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


Joined: Mar 30, 2006
Posts: 2402
Location: Pennsylvania

PostPosted: Thu Jan 07, 2010 11:32 am Reply with quote Back to top

I believe that to be correct. Wink
View user's profile Send private message Visit poster's website
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Thu Jan 07, 2010 11:59 am Reply with quote Back to top

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
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Thu Jan 07, 2010 12:05 pm Reply with quote Back to top

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


Joined: Mar 30, 2006
Posts: 2402
Location: Pennsylvania

PostPosted: Thu Jan 07, 2010 1:37 pm Reply with quote Back to top

Yes, where you can you should be using the defined constants in modules and blocks, BLOCK_FILE and MODULE_FILE
View user's profile Send private message Visit poster's website
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Thu Jan 07, 2010 3:02 pm Reply with quote Back to top

Thanks a lot.
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Sun Jan 10, 2010 11:56 am Reply with quote Back to top

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
View user's profile Send private message
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Sun Jan 10, 2010 1:47 pm Reply with quote Back to top

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


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

PostPosted: Mon Jan 11, 2010 6:31 pm Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

PostPosted: Thu Jan 21, 2010 2:59 am Reply with quote Back to top

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
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum