Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2007
    Posts
    1
    Plugin Contributions
    0

    Default [Done v1.3.8] var declaration in sessions.php

    I downloaded 1.3.7 and found an error in sessions.php.

    That is, admin/includes/classes/sessions.php

    According to the PHP manual, only constant initializers for var variables are allowed. To initialize variables with non-constant values, you need to use the constructor function.

    Specifically, in class php3session, the var declaration for $cookie_path should be changed to:

    var $cookie_path;

    and this line should be added to the php3session function:

    $this->cookie_path = substr(DIR_WS_ADMIN, 0, -1);

    At least, I believe this is a coding error, and if I'm wrong I apologize for troubling you.

    John

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: var declaration in sessions.php

    Quote Originally Posted by nesredep View Post
    I downloaded 1.3.7 and found an error in sessions.php.

    That is, admin/includes/classes/sessions.php
    John,
    You're absolutely right ... that is bad code.

    That's why that file is actually not used by Zen Cart.

    Thanks for reminding us to remove the obsolete file.

    The "real" file for handling sessions in v1.3.x is /includes/functions/sessions.php, shared by admin and catalog code.
    .

    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.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 11 Apr 2014, 09:52 PM
  2. Replies: 1
    Last Post: 10 Jun 2013, 08:33 PM
  3. Replies: 0
    Last Post: 26 Feb 2008, 10:10 AM
  4. Replies: 5
    Last Post: 15 Jan 2008, 07:27 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