Function ereg() is deprecated

Hi all!

According to draft proposal I MUST include in layout customer’s existing header.php and footer.php templates.

But then I try to include them, Yii generate error:


PHP error


Function ereg() is deprecated 



It because customer’s templates uses ereg() function:


 <?$uri = $_SERVER['REQUEST_URI']; if (ereg("inc_file.php", $uri))

Is any possibility to disable/bypass this error without customers templates correction?

Maybe this will help you!

other

Galin Velchev, thank for reply, but this solution need to edit customer’s template files (replace ereg to preg_match). Is any possibility to avoid this?

SOLVED!

This error issued in PHP 5.3

To allow using ereg* function in PHP 5.3

Find in php.ini:


; overload(replace) single byte functions by mbstring functions.

; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),

; etc. Possible values are 0,1,2,4 or combination of them.

; For example, 7 for overload everything.

; 0: No overload

; 1: Overload mail() function

; 2: Overload str*() functions

; 4: Overload ereg*() functions

;mbstring.func_overload = 0

uncomment and set:


mbstring.func_overload = 5 

this will enable mail() and ereg*() (1+4) without any refactoring of customer’s files!

[color="#008000"]NOTE: moved to proper section (General PHP Topics instead of General Discussion for Yii 1.1.x)[/color]