Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,838
    Plugin Contributions
    31

    Default Re: Naming a global variable the same as a SESSION, GET or POST variable

    you can safely remove the code.
    So to be completely clear, all eight instances of

    PHP Code:
    unset($GLOBALS[$key]); 
    in

    init_santize.php

    can be commented out for the moment?
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Naming a global variable the same as a SESSION, GET or POST variable

    Quote Originally Posted by wilt View Post
    Hi

    As suggested by other posters here, the code in init_sanitize that will unset certain $GLOBAL values was done for security reasons, and was meant to 'imitate' setting register_globals=off.

    However register_globals was deprecated in php 5.3 and removed in php 5.4, so the benefit of the code in init_sanitize is moot.

    If you are using php 5.4 and therefore sure that register_globals is no longer used, then you can safely remove the code.
    In the short term and to make upgrading easier, you could use the overrides directory under the init_includes directory.

    We will address this in v155.
    Quote Originally Posted by torvista View Post
    So to be completely clear, all eight instances of

    PHP Code:
    unset($GLOBALS[$key]); 
    in

    init_santize.php

    can be commented out for the moment?
    That's a method to accomplish what was said. The initial solution being to copy includes/init_includes/init_sanitize.php to includes/init_includes/overrides and then modify the file in that directory to eliminate the removal of the global variables when the equivalently named other type variable is passed...

    It could maybe be misinterpreted to mean completely remove all content of init_sanitize.php, but I wouldn't go so far as that considering we were primarily focused on the unsettng of the global variables. But if the other actions imitate register_globals=off functionality then yeah, that/those sections also.

    Just make sure your upgrade process includes review of the overrides folder at some point.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. where can i add a global custom email variable
    By eVelt in forum General Questions
    Replies: 1
    Last Post: 19 Dec 2013, 06:22 PM
  2. v151 Global variable for total shipment weight
    By d0ugparker in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 21 Sep 2013, 03:58 PM
  3. v150 Can I add another variable to the session?
    By tifischer in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jul 2013, 08:29 PM
  4. Replies: 8
    Last Post: 10 Jan 2010, 08:04 PM
  5. Why isn't my global variable working?
    By lat9 in forum General Questions
    Replies: 1
    Last Post: 1 Oct 2009, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg