Deprecated after updating to PHP 5.3
#1
Posted 08 November 2011 - 08:00 PM
I got a million Deprecated errors and I manually installed this addon http://www.oscommerc...tributions,7394
It fixed almost everything expect for a few errors.
I cannot checkout+add an item to my cart.
This is the error I get during checkout
Deprecated: Function split() is deprecated in /home/XXXX/public_html/XXXX.com/includes/functions/general.php on line 1061
Warning: Cannot modify header information - headers already sent by (output started at /home/XXXX/public_html/XXXXX/includes/functions/general.php:1061) in /home/XXXXX/public_html/XXXXXX/includes/functions/general.php on line 38
Any ideas what is causing this error?
Thanks
#2 ONLINE
Posted 08 November 2011 - 09:49 PM
split('pattern', $string)
needs to be changed topreg_split('/pattern/', $string)
Note that if the pattern contains / already, you could use another character such as #, or you can escape the /'s inside the pattern with \ (\/).
#3
Posted 09 November 2011 - 01:55 AM
I am only finding 1 more Error.
When browsing my products this will show up at the top of the product list ONLY on page 2+
Deprecated: Function ereg() is deprecated in /home/XXXX/public_html/XXXXX/index.php on line 291
any idea what it is?
#4 ONLINE
Posted 09 November 2011 - 02:24 AM
#5
Posted 09 November 2011 - 03:57 AM
MrPhil, on 09 November 2011 - 02:24 AM, said:
Thank you so much for leading me in the right direction, I found information about converting them at these two links:
http://devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53/
.http://www.php.net/manual/en/reference.pcre.pattern.posix.php
Thanks Again!
#6
Posted 09 November 2011 - 04:26 AM
in banner manager(admin)
Parse error: syntax error, unexpected '{' in /home/XXXXX/public_html/XXXXXXX/XXXXXXXX/includes/classes/phplot.php on line 782
line 782 in that file if (eregi($asked, $accepted)) {
Ive tried to do all of the following and still get errors
if (preg_match($asked, $accepted)) {
if (preg_match('/$asked, $accepted/'i)) {
if (preg_match('/$asked/', $accepted)) {
if (preg_match('/$asked/i', $accepted)) {
if (preg_match('/$asked, $accepted/i')) {
if (preg_match('/$asked, $accepted)/') {
if (preg_match('/$asked, $accepted))/' {
if (preg_match('/$asked, $accepted))/i' {
if ( preg_match('{' . $asked . '}i', $accepted) ) {
if (preg_match('/' . $asked .'/i', $accepted)) {
Am I doing something fundamentaly wrong or looking in the wrong place?
Edited by xoxx, 09 November 2011 - 04:37 AM.
#7 ONLINE
Posted 09 November 2011 - 05:52 PM
if (preg_match("/$asked/i", $accepted)) {
Note: if $asked might ever contain a slash / , this will break. Either use some other character (e.g., # or &) to delimit the pattern, or process $asked to change / to \/ (that's backslash-slash, not a Vee).
I suggest that you learn some basic PHP before attempting to edit code.
#8
Posted 09 November 2011 - 06:03 PM
8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.
Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.
Any issues with oscommerce, I am here to help you.
#9
Posted 10 November 2011 - 01:08 AM
I have searched this exact phrase on google and found where they offered a replacement code. It still didn't work for me, that's why I'm asking.
#10
Posted 10 November 2011 - 11:03 AM
#11
Posted 14 November 2011 - 06:57 PM
I upgraded to PHP 5.3.8 and that will create problems for you since it looks like you're using PHP4.
Sticky Pod
www.stickypod.com
#12
Posted 14 November 2011 - 07:58 PM
Can you paste in the entire phplot.php code thanks. It may make it easier to determine the source of the error.
Also when you tried those variations, did you get the same error or did the error change?
- Another discussion about infected files ::here::
- A discussion on file permissions ::here::
- Site hacked? Should you upgrade or not, some thoughts ::here::
- Ignore this link - just a honeypot site to test my ideas out for osC_Sec and allow the site to be picked up by attackers.
- Fix the admin login bypass exploit here
- Aegis Security: New security addon I am developing, a remake of osC_Sec in PHP 5 with a number of fixes
#13
Posted 14 November 2011 - 08:03 PM
function SetPlotType($which_pt) {
$accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
$asked = trim($which_pt);
if (eregi($asked, $accepted)) {
$this->plot_type = $which_pt;
return true;
} else {
$this->DrawError('$which_pt not an acceptable plot type');
return false;
}
}
From osC 2.3.1
function SetPlotType($which_pt) {
$accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
$asked = trim($which_pt);
if (preg_match('/' . $asked .'/i', $accepted)) {
$this->plot_type = $which_pt;
return true;
} else {
$this->DrawError('$which_pt not an acceptable plot type');
return false;
}
}
- Another discussion about infected files ::here::
- A discussion on file permissions ::here::
- Site hacked? Should you upgrade or not, some thoughts ::here::
- Ignore this link - just a honeypot site to test my ideas out for osC_Sec and allow the site to be picked up by attackers.
- Fix the admin login bypass exploit here
- Aegis Security: New security addon I am developing, a remake of osC_Sec in PHP 5 with a number of fixes
#14 ONLINE
Posted 16 November 2011 - 03:07 AM
if (eregi($asked, $accepted)) {
and if (preg_match('/' . $asked .'/i', $accepted)) {
and for that mattter, if (preg_match("/$asked/i", $accepted)) {
are identical in function (provided that $asked does not contain slashes / ).All of these will work in PHP 4 and 5. As of PHP 5.3, you will get lots of annoying warning messages with the eregi() version. At some point in the future, the eregi() will stop working.
#15 ONLINE
Posted 16 November 2011 - 03:26 AM
if (eregi($asked, $accepted)) {
and if (preg_match('/' . $asked .'/i', $accepted)) {
and for that mattter, if (preg_match("/$asked/i", $accepted)) {
are identical in function (provided that $asked does not contain slashes / ).All of these will work in PHP 4 and 5. As of PHP 5.3, you will get lots of annoying warning messages with the eregi() version.
#16
Posted 16 November 2011 - 07:11 PM
Posted 08 November 2011, 21:49
Either the mod's author missed one, or you have a mod added to your installation. Either way,
split('pattern', $string)
needs to be changed to
preg_split('/pattern/', $string)
Note that if the pattern contains / already, you could use another character such as #, or you can escape the /'s inside the pattern with \ (\/).
#17 ONLINE
Posted 17 November 2011 - 01:41 AM









