Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Finland
    Posts
    488
    Plugin Contributions
    3

    Default [Duplicate] IPv6 sanitize problem

    In /includes/init_includes/init_sanitize.php there is a code that reads:

    Code:
    /**
     * sanitize $_SERVER vars
     */
      $_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9.%]/', '', $_SERVER['REMOTE_ADDR']);
    This brakes $_SERVER['REMOTE_ADDR'] if the server is running on IPv6

    My machine LAN IPv4 address is 192.168.1.30, which in IPv6 is fe80:0:0:0:0:0:c0a8:11e, but the above outputs 80000000811 which is kinda wrong.

    (sorry if this has been reported before, I tried searching "ipv6", but it returned whole lot of unrelated threads which didn't seem to have the string "ipv6" in them!)
    Working with Zen Cart since 2003 :: www.prr.fi
    Author of the original Finnish language pack for Zen Cart since 2004

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: $_SERVER['REMOTE_ADDR'] IPv6 sanitize problem

    .

    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. Sanitize contact form user input
    By betheone in forum General Questions
    Replies: 5
    Last Post: 17 Jan 2012, 03:33 PM
  2. IPv6 and Payments Pro
    By The Other Air Force in forum PayPal Website Payments Pro support
    Replies: 3
    Last Post: 10 Nov 2011, 08:58 PM
  3. [Done v1.5.1] IPv6 error
    By PhillipJFey in forum Bug Reports
    Replies: 1
    Last Post: 11 May 2011, 05:59 PM
  4. Replies: 3
    Last Post: 12 Feb 2011, 12:34 AM
  5. Duplicate orders problem (again!)
    By dome90uk in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 15 Jul 2010, 06:19 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR