Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-22 11:06:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

[SOLVED] How do i fix deprecated Function eregi()?

I am using the act_if_mobile plugin and I get an error due to a deprecated function. The suggestion on takien.com does not help. The line with the problem is:

if(eregi('up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp',$_SERVER['HTTP_USER_AGENT'])){
		return true;
	}

can anyone suggest a fix for this?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2012-12-22 17:58:58

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [SOLVED] How do i fix deprecated Function eregi()?

if(preg_match('/(up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp)/i', $_SERVER['HTTP_USER_AGENT']))
{
	return true;
}

Offline

#3 2012-12-23 06:43:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: [SOLVED] How do i fix deprecated Function eregi()?

Thanks sooo much Ruud. That indeed fixes it.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB