Forums / Bug Reports / [Done v1.6.0] Redundant code in init_sanitize.php

[Done v1.6.0] Redundant code in init_sanitize.php

Started by i_make_robots on 5 Jan 2013, 8:23 PM · Views: 787

Results 1 to 2 of 2
5 Jan 2013, 8:23 PM
#1
i_make_robots avatar

i_make_robots

New Zenner

Join Date:
Aug 2012
Posts:
46
Plugin Contributions:
0

[Done v1.6.0] Redundant code in init_sanitize.php

/**
 * process all $_SESSION terms
 */
  if (isset($_SESSION) && count($_SESSION) > 0) {
    foreach($_SESSION as $key=>$value){
      if(is_array($value)){
        foreach($value as $key2 => $val2){
          unset($GLOBALS[$key]);  // <<-- shouldn't this be key2 ?
        }
      } else {
        unset($GLOBALS[$key]);
      }
    }
  }
8 Jan 2013, 7:44 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done v1.6.0] Redundant code in init_sanitize.php

It's actually redundant.

The redundant code will be removed in v1.6.0.

Leaving it as-is is harmless. THERE IS NO NEED TO APPLY THIS TO EXISTING SITES PRIOR TO UPGRADING TO 1.6.0

THIS IS NOT A BUG. Merely inefficient code, probably leftover from some legacy components.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.