Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

parse error on unset command with php 4.3.3


lagi

Recommended Posts

Hi,

 

I was moving dedicated servers and tarred up my OSC from the old server. Transferred to new server and got all sorts of errors.

 

I decided to use a virgin copy of osc via cpanel installation - but that too has errors. Seems this happens at the code anywhere where there is an unset command on the temporary variable. Thgis also happened with a virgin install of nuke - unset command again.

 

The only difference i can see with the two servers is the one had redhat 7.5 and the new one is redhat 9. PHP is version 4.3.3 on both and as far as I can see the ini files are the same (ie default).

 

Parse error: parse error in /home/folder/public_html/osc/includes/functions/general.php on line 637

 

here is the code

// Break up $search_str on whitespace; quoted string will be reconstructed later
   $pieces = split('[[:space:]]+', $search_str);
   $objects = array();
   $tmpstring = '';
   $flag = '';

   for ($k=0; $k<count($pieces); $k++) {
     while (substr($pieces[$k], 0, 1) == '(') {
       $objects[] = '(';
       if (strlen($pieces[$k]) > 1) {
         $pieces[$k] = substr($pieces[$k], 1);
       } else {
         $pieces[$k] = '';
       }
     }

<snip>
         for ($j=0; $j<count($post_objects); $j++) {
           $objects[] = $post_objects[$j];
         }
         unset($tmpstring);
         continue;
       }

The code in nuke is smaller

function cookiedecode($user) {
   global $cookie, $prefix, $db, $user_prefix;
   $user = base64_decode($user);
   $cookie = explode(":", $user);
   $sql = "SELECT user_password FROM ".$user_prefix."_users WHERE username='$cookie[1]'";
   $result = $db->sql_query($sql);
   $row = $db->sql_fetchrow($result);
   $pass = $row[user_password];
   if ($cookie[2] == $pass && $pass != "") {
return $cookie;
   } else {
unset($user);
unset($cookie);
   }
}

 

In the second case unset($user) gives the error but if I comment out that line

then unset($cookie) has the problem. Same happens in the general.php file in osc

commenting unset command goes to the next one in the file.

 

 

I have been on this for 2 days now - others have hd the problem (google search showed the problem) but so far no answers

 

 

Any help appreciated - could it be a PHP bug plus later revisions of Operating system

 

REgards Lagi

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...