Are you getting messages like these in your CubeCart site?
Deprecated: Function eregi() is deprecated in /home/…/public_html/includes/sslSwitch.inc.php on line 30
Deprecated: Function eregi() is deprecated in /home/…/public_html/includes/session.inc.php on line 30
Deprecated: Function ereg() is deprecated in /home/…/public_html/includes/functions.inc.php on line 119
Warning: Cannot modify header information – headers already sent by (output started at /home/…/public_html/includes/sslSwitch.inc.php:30) in /home/…/public_html/includes/session.inc.php on line 95
Deprecated: Function eregi() is deprecated in /home/…/public_html/includes/currencyVars.inc.php on line 30
Deprecated: Function eregi() is deprecated in /home/…/public_html/includes/content/index.inc.php on line 30
Deprecated: Function eregi_replace() is deprecated in /home/…/public_html/includes/functions.inc.php on line 64
What does this mean?
To put it simply, it means that your web hosting company has updated php, one of the programming languages your CubeCart site was built with, and the CubeCart programs can no longer cope with it.
The technical explanation
Here\’s a more technical explanation, in case you want to try to fix it yourself. Let\’s assume you have at least a basic knowledge of php, and you know how to get access to the programming that makes up your site (via cPanel or ftp or similar), and that you have made a backup of your site before you start playing with the programming.
\”Deprecated\” means that a particular function of the language is no longer available. In this case, the functions are ereg, eregi and eregi_replace. If you click on those links, you can find out more about what each function used to do. But basically, ereg and similar functions would look for a sequence of characters within a string variable, and (with the _replace functions) optionally replace those characters with other characters.
These functions were very useful for manipulating strings, but were deprecated in version 5.3.0 of php, and removed in version 7.0.0. What this means is (1) if your CubeCart site still uses this old code, your website will start giving error messages like these when your web hosting company updates to version 5.3.0 of php, and (2) when they update to 7.0.0, it won\’t work at all. At the time of writing, in mid April 2019, php is up to version 7.1.28. You can find out about the release history of php here, but basically 5.3.0 is pretty much dead after August 2014. I wrote about that in early 2017, and WordFence wrote a great post last year, but there are still a lot of old CubeCart sites online.
So what can you do about it if you are a programmer? Basically, the ereg expressions need to be replaced with an equivalent preg expression. For example, the format for preg_match, which replaces ereg, is
preg_match ( string$pattern
, string$subject
[, array&$matches
[, int$flags
= 0 [, int$offset
= 0 ]]] ) : int
ereg ( string$pattern
, string$string
[, array&$regs
] ) : int
But what if you are not a programmer?