Forums / Craftwork / Server-side / eregi_replace

eregi_replace giving errors

aro747
#1 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

 

Trustmaster
#2 2011-08-10 07:39

You should update at least to V126, it has this fixed.

May the Source be with you!
aro747
#3 2011-08-11 19:57

Thanks, where can I get that from?

pieter
#4 2011-08-12 05:44

This is V126 http://www.boxca.com/ddk8m8h46e3c/seditio-build126.rar.html
Upgrade script is here: http://trac.cotonti.com/export/585/trunk/upgrade-seditio12x-to-seditio125.php

But you need to go to 125 first I guess: See doc: 121 to 125/126

I propose, because I can't find 125. You use the files from 126 and follow the upgrade script above.

You know the blabla about testsite, backup, ...

Added 20 minutes later:

In Cotonti Genoa 0.0.6 you can also find the script.

Maybe upgrade directly to Cotonti. See http://www.cotonti.com/docs/start/updating#ch_update latest part: Upgrading from Seditio

... can we help you ...

Dit bericht is bewerkt door pieter (2011-08-12 06:07, 12 jaren ago)
aro747
#5 2011-08-15 01:20

Thank you.