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.4 RN Issues
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Fri Nov 06, 2009 7:09 am Reply with quote

I would like to replace all eregi from RavenNuke 2.4

Code:
/*********************************************************/

/* text filter                                           */
/*********************************************************/

function check_words($Message) {
   global $CensorMode, $CensorReplace, $EditedMessage, $CensorList;
   include_once(INCLUDE_PATH.'config.php');
   $EditedMessage = $Message;
   if ($CensorMode != 0) {
      if (is_array($CensorList)) {
         $Replace = $CensorReplace;
         if ($CensorMode == 1) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = eregi_replace("$CensorList[$i]([^a-zA-Z0-9])","$Replace\\1",$EditedMessage);
            }
         } elseif ($CensorMode == 2) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = eregi_replace("(^|[^[:alnum:]])$CensorList[$i]","\\1$Replace",$EditedMessage);
            }
         } elseif ($CensorMode == 3) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = eregi_replace("$CensorList[$i]","$Replace",$EditedMessage);
            }
         }
      }
   }
   return $EditedMessage;
}


REplace with

Code:
/*********************************************************/

/* text filter                                           */
/*********************************************************/

function check_words($Message) {
   global $CensorMode, $CensorReplace, $EditedMessage, $CensorList;
   include_once(INCLUDE_PATH.'config.php');
   $EditedMessage = $Message;
   if ($CensorMode != 0) {
      if (is_array($CensorList)) {
         $Replace = $CensorReplace;
         if ($CensorMode == 1) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = preg_match("/$CensorList[$i]([^a-zA-Z0-9])/","$Replace\\1",$EditedMessage);
            }
         } elseif ($CensorMode == 2) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = preg_match("/(^|[^[:alnum:]])$CensorList[$i]/","\\1$Replace",$EditedMessage);
            }
         } elseif ($CensorMode == 3) {
            for ($i = 0; $i < count($CensorList); $i++) {
               $EditedMessage = preg_match("/$CensorList[$i]/","$Replace",$EditedMessage);
            }
         }
      }
   }
   return $EditedMessage;
}


Am I correct?
This code comes from the mainfile.php
 
View user's profile Send private message
jakec
Site Admin



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

PostPosted: Fri Nov 06, 2009 12:12 pm Reply with quote

There is a discussion within the forums on replacing Eregi. Might be worth a read. Wink
 
View user's profile Send private message
montego
Site Admin



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

PostPosted: Fri Nov 06, 2009 6:26 pm Reply with quote

unicornio, for now, I would add the ^E_DEPRECATED to the $error_reporting variable within rnconfig.php and just wait for us to change everything over. It is on our to-do list for 2.5.

_________________
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
hicuxunicorniobestbuildpc







PostPosted: Sun Jan 24, 2010 8:19 am Reply with quote

I want you to know I tested the code above but unfortunatly it doesnt work. When I go to modules I can see 0 on the names of every module and in blocks I got the same result. Sad

What could be the solution for this?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN 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 ©