Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default [Done v1.5.5f] zen_post_all_get_params throws warnings on $_GET array variables

    Doing a regular "log inspection" on a client's site and came across a bunch of logs complaining that:
    Code:
    PHP Warning:  trim() expects parameter 1 to be string, array given in xxxx\includes\functions\functions_general.php
    I've modeled the issue in a local test site, with the following log as confirmation:
    Code:
    [10-Aug-2017 12:09:20 America/New_York] Request URI: /xxx/index.php?selskin=..%2Finc%2Fboxleft.inc%00&xposbox[L][]=%2Fetc%2Fpasswd%00, IP address: ::1
    #1  trim() called at [C:\xampp\htdocs\xxx\includes\functions\functions_general.php:62]
    #2  zen_parse_input_field_data() called at [C:\xampp\htdocs\xxx\includes\functions\functions_general.php:76]
    #3  zen_output_string() called at [C:\xampp\htdocs\xxx\includes\functions\html_output.php:469]
    #4  zen_draw_hidden_field() called at [C:\xampp\htdocs\xxx\includes\functions\functions_general.php:193]
    #5  zen_post_all_get_params() called at [C:\xampp\htdocs\xxx\includes\modules\sideboxes\currencies.php:29]
    #6  require(C:\xampp\htdocs\xxx\includes\modules\sideboxes\currencies.php) called at [C:\xampp\htdocs\xxx\includes\modules\column_right.php:32]
    #7  require(C:\xampp\htdocs\xxx\includes\modules\column_right.php) called at [C:\xampp\htdocs\xxx\includes\templates\my_template\common\tpl_main_page.php:184]
    #8  require(C:\xampp\htdocs\xxx\includes\templates\my_template\common\tpl_main_page.php) called at [C:\xampp\htdocs\xxx\index.php:97]
    
    [10-Aug-2017 12:09:20 America/New_York] PHP Warning:  trim() expects parameter 1 to be string, array given in C:\xampp\htdocs\xxx\includes\functions\functions_general.php on line 62
    The issue appears to start with zen_post_all_get_params not recognizing $_GET variables that are arrays (the zen_get_all_get_params does have such recognition).

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

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    Quote Originally Posted by lat9 View Post

    [10-Aug-2017 12:09:20 America/New_York] Request URI: /xxx/index.php?selskin=..%2Finc%2Fboxleft.inc%00&xposbox[L][]=%2Fetc%2Fpasswd%00, IP address: ::1
    I'm a bit worried that you're modeling it by doing hack attempts...
    .

    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.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    Quote Originally Posted by DrByte View Post
    I'm a bit worried that you're modeling it by doing hack attempts...
    Well, it was the result of a SecurityMetrics scan that caused the issues.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    Fair. Good to know that it's not occurring in "real world" normal operations.
    .

    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.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    I think the fix is as simple as adding these couple lines: Ignore sub-arrays in zen_get/post_all_get_params
    .

    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.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    I was going to suggest something along those lines; there shouldn't be any $_GET array-variables anymore ... should there?

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,692
    Plugin Contributions
    9

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    Quote Originally Posted by DrByte View Post
    I think the fix is as simple as adding these couple lines: Ignore sub-arrays in zen_get/post_all_get_params
    i think this is an EXCELLENT idea....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: zen_post_all_get_params throws warnings on $_GET array variables

    Quote Originally Posted by lat9 View Post
    I was going to suggest something along those lines; there shouldn't be any $_GET array-variables anymore ... should there?
    After further thought, if there shouldn't be any $_GET array-variables ... shouldn't those all be "sanitized" out by /includes/init_sanitize.php? That way, all other processing will also benefit from the removal.

 

 

Similar Threads

  1. v155 Storefront: $_GET variables that are arrays?
    By lat9 in forum General Questions
    Replies: 1
    Last Post: 26 May 2016, 03:22 PM
  2. v151 [Done v1.5.5] PHP 5.4 warnings: Illegal string offset
    By lat9 in forum Bug Reports
    Replies: 38
    Last Post: 28 Dec 2015, 11:13 PM
  3. Replies: 3
    Last Post: 22 Mar 2011, 10:53 AM
  4. Just added SSL. IE throws warnings. FF doesn't.
    By stiggy100 in forum General Questions
    Replies: 1
    Last Post: 29 Oct 2009, 04:34 AM
  5. Replies: 0
    Last Post: 13 Oct 2008, 10:08 AM

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