Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Admin Sanitize Blocking Custom Function

    Hi All,
    Running 1.5.5e on PHP7. I have a custom module that allows uploading a PDF from the admin which also adds a database record. This is for product manual and such. It's worked for years and years, but now in 1.5.5 I get a redirect to the admin home page. So I added a file in admin/includes/init_includes with

    define('DO_DEBUG_SANITIZATION', 'true');

    here's what I get
    Code:
    Jan-04-2018 07:07:37
    =================================
    
    Incoming GET Request Array
    (
        [pId] => 5926
        [action] => upload_the_file
    )
    
    
    Incoming POST Request Array
    (
    )
    
    
    Running Admin Sanitizers
    
    PROCESSING SIMPLE_ALPHANUM_PLUS(GET) == action
    
    PROCESSING SIMPLE_ALPHANUM_PLUS(GET) == pId
    
    Outgoing GET Request Array
    (
        [pId] => 5926
        [action] => upload_the_file
    )
    
    
    Outgoing POST Request Array
    (
    )
    
    
    Jan-04-2018 07:07:37
    =================================
    
    Incoming GET Request Array
    (
    )
    
    
    Incoming POST Request Array
    (
    )
    
    
    Running Admin Sanitizers
    
    Outgoing GET Request Array
    (
    )
    
    
    Outgoing POST Request Array
    (
    )
    To the admin/includes/init_includes/init_sanitize.php I've added 'pId' to the $group array for
    $sanitizer->addSimpleSanitization('SIMPLE_ALPHANUM_PLUS', $group);

    What am I missing here?

    Thank You,
    John

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

    Default Re: Admin Sanitize Blocking Custom Function

    Quote Originally Posted by bumba000 View Post
    Hi All,
    Running 1.5.5e on PHP7. I have a custom module that allows uploading a PDF from the admin which also adds a database record. This is for product manual and such. It's worked for years and years, but now in 1.5.5 I get a redirect to the admin home page. So I added a file in admin/includes/init_includes with

    define('DO_DEBUG_SANITIZATION', 'true');

    here's what I get
    Code:
    Jan-04-2018 07:07:37
    =================================
    
    Incoming GET Request Array
    (
        [pId] => 5926
        [action] => upload_the_file
    )
    
    
    Incoming POST Request Array
    (
    )
    
    
    Running Admin Sanitizers
    
    PROCESSING SIMPLE_ALPHANUM_PLUS(GET) == action
    
    PROCESSING SIMPLE_ALPHANUM_PLUS(GET) == pId
    
    Outgoing GET Request Array
    (
        [pId] => 5926
        [action] => upload_the_file
    )
    
    
    Outgoing POST Request Array
    (
    )
    
    
    Jan-04-2018 07:07:37
    =================================
    
    Incoming GET Request Array
    (
    )
    
    
    Incoming POST Request Array
    (
    )
    
    
    Running Admin Sanitizers
    
    Outgoing GET Request Array
    (
    )
    
    
    Outgoing POST Request Array
    (
    )
    To the admin/includes/init_includes/init_sanitize.php I've added 'pId' to the $group array for
    $sanitizer->addSimpleSanitization('SIMPLE_ALPHANUM_PLUS', $group);

    What am I missing here?

    Thank You,
    John
    There does not appear to be anything that is being sanitized from the sanitizer perspective. What is provided in is coming out... But, in the discussion, you elude to a few things which need to be explained or addressed before able to provide the correct assistance.
    Worked for years and years: on what Version of ZC or what has changed to make it stop in the two years that a version of ZC 1.5.5 has been out?

    Technically, if had been also keeping up with the ZC announcements, the sanitizer files should have already been applied to any 1.5.x site as part of one's continued maintenance and security operations. So, if there was a sanitizer rule necessary "before" it would remain the same now.

    Not seeing that any data is posted nor sufficient information applied to as a GET parameter related to whatever file is being uploaded. That is likely due to differences of underlying ZC software and the version for which this additional code was written.

    At this time based on the provided log file, the sanitizer class first applied to ZC 1.5.5 has nothing to do with the issue experienced.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Admin Sanitize Blocking Custom Function

    Hey MC,
    It worked on 1.3.9 and 1.5.1.

    Thank You, John

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Admin Sanitize Blocking Custom Function

    Quote Originally Posted by bumba000 View Post
    Hey MC,
    It worked on 1.3.9 and 1.5.1.

    Thank You, John
    If willing to provide the code could figure out what it is doing that results in not doing the upload/update. It more than likely is a result of some other architectural change in ZC, but there really isn't enough information made available yet.

    Admin related modification that touches the database and apparently transfers a file (probably doesn't load the upload class correctly now that I think about it. In ZC 1.5.5 it got moved to the catalog side of operation and I thought there were some other changes made to it as well which could affect this mod.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Admin Sanitize Blocking Custom Function

    I found the problem. I had not changed a couple of the mysql_query statements to $db->Execute...

    Sorry about that. Thank You!

    John
    Last edited by bumba000; 4 Jan 2018 at 09:41 PM.

  6. #6
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Admin Sanitize Blocking Custom Function

    There was also an issue with the file size.

    Thanks again,
    John

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Admin Sanitize Blocking Custom Function

    No problem... Though threw me for a loop that I had received the code in its entirety and then when coming back here find it wasn't present. :) Thought I had lost my mind. :)

    That was at least one of the areas that I was going to suggest adjusting (mysql_ to $db->) though there could have been some underlying reason to use that style of code which would just have to be modified/updated anyways.

    Glad to have helped even if a little.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 [Duplicate] IPv6 sanitize problem
    By pasi in forum Bug Reports
    Replies: 1
    Last Post: 1 Nov 2013, 03:23 AM
  2. Sanitize contact form user input
    By betheone in forum General Questions
    Replies: 5
    Last Post: 17 Jan 2012, 03:33 PM
  3. Replies: 3
    Last Post: 12 Feb 2011, 12:34 AM
  4. Adding custom function, calling custom code from pages.
    By madteckhead in forum General Questions
    Replies: 6
    Last Post: 14 Jun 2007, 08:24 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