Function ereg() is deprecated

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Function ereg() is deprecated

Postby bcddd214 » Sun Feb 24, 2013 2:36 pm

Using asterisk-1.4.21.2 on Gentoo amd_64 with astguiclient_2.2.1.zip / astguiclient_2.4rc1.zip / and the latest one.
Following the installation method in the docs/BASE_INSTALL.txt

Deprecated: Function ereg() is deprecated in /var/www/localhost/htdocs/vicidial/dbconnect.php on line 15

It chokes on if (ereg("^PATHlogs", $DBCline)) because your code is so old it's about to fall apart.
if (preg_match("/^PATHlogs/", $DBCline)) properly updates the code but that opens up a whole new nightmare of
Notice: Undefined index: PHP_AUTH_USER in /var/www/localhost/htdocs/vicidial/admin.php on line 93

I even tried switching you to pdo and that gives pretty much the same effect.
You run VoIP on code this out of date?
Hackers/voip thieves must love vicidial.
do you realize that mysql_connect() is dead for a reason?

iso install is 'not' and option
bcddd214
 
Posts: 38
Joined: Fri Aug 15, 2008 4:22 pm

Re: Function ereg() is deprecated

Postby bcddd214 » Sun Feb 24, 2013 2:44 pm

I even tried to downgrade php, same results
>=dev-lang/php-5.4.8:5.4
>=dev-lang/php-5.3.18:5.3

your code is horribly out of date. You're almost beyond duct tape repairable.
bcddd214
 
Posts: 38
Joined: Fri Aug 15, 2008 4:22 pm

Re: Function ereg() is deprecated

Postby mflorell » Sun Feb 24, 2013 3:47 pm

What version of PHP are you using?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Function ereg() is deprecated

Postby bcddd214 » Sun Feb 24, 2013 5:25 pm

in the posting above.
the current stable php release is 5.4.12
I have downgraded as low as gentoo/portage will go. That's how old the vicidial code is.
bcddd214
 
Posts: 38
Joined: Fri Aug 15, 2008 4:22 pm

Re: Function ereg() is deprecated

Postby williamconley » Sun Feb 24, 2013 5:57 pm

Is that a volunteer to replace ereg with preg or some other function throughout the system? 8-)

At PoundTeam we have Vicidial running on Ubuntu 12.04LTS and receive notices of the deprecation, but it does not "choke". Perhaps you can reduce your warning level?

We are at PHP 5.3.10-1ubuntu3.5 with Suhosin-Patch ... and Ubuntu 12.04 LTS released only a little while ago. Seems to not be a problem ... but if you want to fix that function, I'm sure it could be included in the codebase ... :)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Function ereg() is deprecated

Postby mflorell » Sun Feb 24, 2013 7:29 pm

The Vicidial source code started 10 years ago, back when ereg was the ONLY built-in option for regular expressions and preg was an optional add-on that required additional software beyond perl itself to work. The NOTICE for ereg to be depricated was added years ago in PHP5 releases when the roadmap for PHP6 came out, then the PHP6 release schedule was scrapped and revised many times, but the ereg NOTICE was still left in place even though it would be years until the function was actually removed in the latest PHP stable release. ereg still works just fine in PHP5, it just throws a NOTICE, which does not impact the functionality of the script at all. I would suggest just disabling NOTICES unless you need them because you are debugging PHP on your system, they should have no effect on how Vicidial functions.

Changing the hundreds of "ereg" functions in the Vicidial PHP code to "preg" is on our development roadmap, and as we add new scripts and code we try to only use preg functions. If you would like to help with this change, we would welcome the help.

I would also like to mention that using ereg is NOT a security issue, and when security issues are found in Vicidial, we fix them quickly and issue an alert through these forums.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Function ereg() is deprecated

Postby bcddd214 » Sun Feb 24, 2013 10:16 pm

Thank you for your reply!
I see a few errors I made.
But I also just found a was to upload your iso to linode, so problem solved.
bcddd214
 
Posts: 38
Joined: Fri Aug 15, 2008 4:22 pm


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 86 guests