Forums / Craftwork / Server-side / eregi_replace

eregi_replace giving errors

aro747
#30422 2011-08-09 01:39

Hi All,

My site has a lot of custom plugins, etc. and unfortunately I can't get a hold of my developer.  Because of all this custom code, I'm still running Seditio V121.  I had my host turn on PDO for another site, and since all are on the same host, I'm getting lots of these errors:  Deprecated: Function eregi_replace() is deprecated in   All are on system/function.php, common.php.  So, I know I have to replace eregi_replace with preg_replace, but exactly how, I'm not sure.  Can you help please?  I'm trying to replace the following lines: 

 

foreach($bbcodes as $bbcode => $bbcodehtml)
		{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }

	if ($cfg['parser_vid'])
and
foreach($bbcodes as $bbcode => $bbcodehtml)
		{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }

	return(substr($text,1));
	}
and
function sed_build_email($email, $hide=0)
	{
	global $L;
	if ($hide)
		{ $result = $L['Hidden']; }
	elseif (!empty($email) && eregi('@', $email))
		{
		$email = sed_cc($email);
		$result = "<a href=\"mailto:".$email."\">".$email."</a>";
		}

	return($result);
	}
and
function sed_build_url($text, $maxlen=64)
	{
	global $cfg;

	if (!empty($text))
		{
		if (!eregi('http://', $text))
			{ $text='http://'. $text; }
		$text = sed_cc($text);
		$text = "<a href=\"".$text."\">".sed_cutstring($text, $maxlen)."</a>";
		}
	return($text);
	}
and
if ($rsedition>0 && $cfg['authmode']>0)
	{
	if (strlen($rseditiop)!=32 || eregi("'",$rseditiop) || eregi("\"",$rseditiop))
		{ sed_diefatal('Wrong value for the password.'); }
and
if ($rsedition>0 && $cfg['authmode']>0)
	{
	if (strlen($rseditiop)!=32 || eregi("'",$rseditiop) || eregi("\"",$rseditiop))
		{ sed_diefatal('Wrong value for the password.'); }
and
'ELQ_COMM_TEXT'			=> $row3['com_date'] ? sed_cc(sed_cutstring(eregi_replace('\[([^\[]*)\]', '', $row3['com_text']), 200)) : '',
If someone could guide me on what to replace the "eregi" with, that would be great. Thanks in advance for your help. -aro