cclayton Posted April 11, 2016 Share Posted April 11, 2016 Hi everyone, Can someone help me understand how to resolve the below error: Warning: extract() expects parameter 1 to be array, null given in /includes/application_top.php on line 214 The line is " extract($_SESSION, EXTR_SKIP);" in the context of what is seen below: if (!ini_get("register_globals")) { if (version_compare(phpversion(), "4.1.0", "<") === true) { if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS; } extract($_SESSION, EXTR_SKIP); } Thanks, Chris Founder & Director at CSC Tours Ltd Link to comment Share on other sites More sharing options...
MrPhil Posted April 11, 2016 Share Posted April 11, 2016 What version of osCommerce, and what version of PHP are you running with? I can't find a match for that code in my archived versions. If it's extremely old osC, you should really update immediately. If it's an ancient version of PHP, get up to date NOW! Link to comment Share on other sites More sharing options...
cclayton Posted April 11, 2016 Author Share Posted April 11, 2016 osCommerce Online Merchant v2.3.4 PHP Version 5.4.42 Founder & Director at CSC Tours Ltd Link to comment Share on other sites More sharing options...
burt Posted April 11, 2016 Share Posted April 11, 2016 The code you posted is definitely not in v2.3.4, and is not in any prior version. Is it some code from an addon? Maybe as part of a bought template? Some code you've come up with yourself? Link to comment Share on other sites More sharing options...
♥kymation Posted April 11, 2016 Share Posted April 11, 2016 The equivalent code from stock osCommerce 2.3.4 is this: if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) { extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS); } Replacing that might solve your problem. However, you may have other problems resulting from whatever you have added that caused this one. Regards Jim See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
MrPhil Posted April 12, 2016 Share Posted April 12, 2016 Do NOT blindly start replacing chunks of code. You need to understand first how you got to the point of having this non-standard code in what is supposedly an up-to-date installation. In your case, $_SESSION is apparently undefined. That could mean that the &= operator is being ignored (or is doing something strange) by current PHP levels, and the problem is why do you have such old code? Is it from some add-on? What is the history of this installation -- what was the initial osC version and what upgrades were done, or is it a fresh 2.3.4 installation? Was this code running successfully, and then your host recently upgraded PHP from some old level? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.