stevebob Posted December 16, 2015 Posted December 16, 2015 I just went through a transition from php 5.3 to 5.5 and ran into a very specific issue that I thought others should know about. Once transitioned I had problems with Session Objects. I would run into instances where the language globals weren't being set correctly. These are set in application_top.php. After digging into how oscommerce handles these, I discovered that it uses an assignment by reference to the $GLOBALS object when assigning these Session objects. What I found out was, with simple data types (string, int, float, etc) this assignment by reference worked. But, if you tried to assign, by reference, something like an array, it would fail. For example, from login.php in the admin folder: tep_session_register('admin'); $admin = array('id' => $check['id'], 'username' => $check['user_name']); prior to 5.5 this worked. After 5.5 this does not work to fix this I had to do the following: tep_session_register('admin'); $_SESSION['admin']= array('id' => $check['id'], 'username' => $check['user_name']); this is tep_session_register function: function tep_session_register($variable) { if (PHP_VERSION < 4.3) { return session_register($variable); } else { if (isset($GLOBALS[$variable])) { $_SESSION[$variable] =& $GLOBALS[$variable]; } else { $_SESSION[$variable] = null; } } return false; }
MrPhil Posted December 17, 2015 Posted December 17, 2015 All this stuff was fixed in the later 2.3.3.x and 2.3.4 releases. Unless you have an overwhelming reason to stay at 2.3.3, such as a very heavily customized store, you would be much better off upgrading to 2.3.4 (or 2.3.4BS), which has PHP 5.6 capability built in.
stevebob Posted December 17, 2015 Author Posted December 17, 2015 unfortunately, I do have a highly customized store
Recommended Posts
Archived
This topic is now archived and is closed to further replies.