[osCommerce] Register Globals MOD (is it going to help me?)

Discussions about MODs and Tips published on our web site.

[osCommerce] Register Globals MOD (is it going to help me?)

Postby jamartin » Thu Jul 17, 2008 8:16 pm

Hi to Everyone.

Firstly, Thanks a lot for the contribution.

I wonder if this MOD is going to help me on my problem. This appeared a few days ago, and I suppose that it is because some sort of upgrading o re-compilling action. The web-hosting company is not answering properly, so I started to search on the net and I into this mod.

It is about a warning that appear below the footer, at the end of each page on the catalog section. It says as follow:

Warning: session_write_close() [function.session-write-close]: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/some_site/some_folder/includes/functions/session.php on line 153


The piece of code around line 153 in session.php is

Code: Select all
  function tep_session_close() {
    if (PHP_VERSION >= '4.0.4') {
      return session_write_close(); //*****Line 153******
    } elseif (function_exists('session_close')) {
      return session_close();
    }
  }



Also, in the admin/whos_online.php page, when I try to see a user's info (shopping cart) by clicking in one of them, it throws a "30 seconds excceded" error in this line in the admin/whos_online.php file:

Code: Select all
    if ($length = strlen($session_data)) {
      if (PHP_VERSION < 4) {
        $start_id = strpos($session_data, 'customer_id[==]s');
        $start_cart = strpos($session_data, 'cart[==]o');
        $start_currency = strpos($session_data, 'currency[==]s');
        $start_country = strpos($session_data, 'customer_country_id[==]s');
        $start_zone = strpos($session_data, 'customer_zone_id[==]s');
      } else {
        $start_id = strpos($session_data, 'customer_id|s');
        $start_cart = strpos($session_data, 'cart|O');
        $start_currency = strpos($session_data, 'currency|s');
        $start_country = strpos($session_data, 'customer_country_id|s');
        $start_zone = strpos($session_data, 'customer_zone_id|s');
      }
      for ($i=$start_cart; $i<$length; $i++) {   // ******************** THIS LINE ***************************
        if ($session_data[$i] == '{') {
          if (isset($tag)) {
            $tag++;
          } else {
            $tag = 1;
          }
        } elseif ($session_data[$i] == '}') {
          $tag--;
        } elseif ( (isset($tag)) && ($tag < 1) ) {
          break;
        }
      }


Seeing at the Database sessions table, i figured that the way the sessions were being stored changed from the usual format

Code: Select all
cart|O:12:"shoppingCart":4:{s:8:"contents";a:0:{}s:5:"total";i:0;s:6:"weight";i:0;s:12:"content_type";b:0;}language|s:7:"espanol";languages_id|s:1:"3";currency|s:2:"CL";navigation|O:17:"navigationHistory":2:{s:4:"path";a:1:{i:0;a:4:{s:4:"page";s:11:"get_cat.php";s:4:"mode";s:6:"NONSSL";s:3:"get";a:2:{s:3:"cid";s:2:"43";s:1:"p";s:4:"7490";}s:4:"post";a:0:{}}}s:8:"snapshot";a:0:{}}wishList|O:8:"wishlist":0:{}referer_url|s:76:"/";


to this other weird format

Code: Select all
q9b59lZkZuX_sCgf9Ajt-m6_nZ_IR2QQdbyUWN4jgDtBE3RSKQxGcbxurs9pNwA-X7WVBz1I09VyCvyiHFVdoBmXnzEi2zxQ7S01dFwJEysjfQVuNwZcXb2LWfLS7aGYYgN_mT_TCGPLFLuibfFz-eR8XO7Ic8c4kYeKPm5Vo6YM_uAyfSDn1MZEje7ERO9yfZ5Q1K1UEOFbmQ85CGOW8gE_gXrJFwkSIcWHjb4LDA6yrQMXrpXDlCGNVbSfyEF8XiRtyMybg6fDZPl9QX1p-18NBT5FbIHWXnvX-iyMf_xwYHa8TidJfjMAESjHoSwjXv6SWhDRxhvXB1-5UmHXt2hM1sj1OcHfKU2e1HzWvT4TOVyIHvpZOruA1f96WT_ZrRk_Gv3v8PbHPxvcf6ysHCVARaH2FHGQfqonDc98Dq7n48m05kEs3aVRe6yDmLlqSwcozsIy9J0z8PKXwq2KFWMkRYqs5paYSsJ4xR2to2CeTLPDlPHkU9YfAYgzlsDUQb5zA740TDTgCVB0kDV6tQiEG7eL-nhYuhvPfeFe0KjscoudWosUmjcoELI5GhoXwLjeVG0yDDYgf4Z5zOX1y6Vz61XHF8F7omDkQKq0yRsYIT3AJDfWh1OaHJNCKjQsExgHIOZlnrSqDh7AFhWa0JPZcrcaYkIFSM6AxAhuP3s.


That's all I've got for this time.

Please, tell me... could this mod help me in resolving this problems??

I am running osC 2.2 RC1, on a PHP 5 MySQL 5 Apache 2 server.

Thanks a lot in advance for the help.
jamartin
 
Posts: 1
Joined: Thu Jul 17, 2008 7:40 pm

Return to MODs and Tips Support

Who is online

Users browsing this forum: No registered users and 1 guest