Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Location
    Connecticut
    Posts
    8
    Plugin Contributions
    0

    Default Attribute manager filtering download filenames.

    I'm using zencart 1.5.5e with the latest version of Download Files From AWS (dated 8/1/17). I've been using this combo for a couple of years and it has been working great. However, it seems that with a recent zen update, the colons are being filtered out of the download filenames. A typical file name should look like this:

    script:amazons3.php:filename

    Any ideas about how to fix this? All existing products are fine, but when I try to add new ones, the colons in the file name disappear:

    this:

    script:amazons3.php:2015-Th01-BruceGreyson-PastPresentAndFutureOfNearDeathStudies.mp3

    becomes:

    scriptamazons3.php2015-Th01-BruceGreyson-PastPresentAndFutureOfNearDeathStudies.mp3

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

    Default Re: Attribute manager filtering download filenames.

    More than likely the ZC sanitization of posted admin data is removing the colon(s). Suggest monitoring the sanitization while entering a new record and then establishing a filter rule that works for the associated content. There is guidance related to sanitization provided through the Docs button in the menu above: https://docs.zen-cart.com/
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Dec 2006
    Location
    Connecticut
    Posts
    8
    Plugin Contributions
    0

    Default Re: Attribute manager filtering download filenames.

    Thanks for the information. I've looked at the doc, https://docs.zen-cart.com/Developer_...ization-groups and the code responsible for the sanitation. I believe that all that is necessary, is to add a colon to the FILE_DIR_REGEX. However, outside of changing the code directly in admin/includes/classes/AdminRequestSanitizer.php, I can't figure out how to do it. Is there some other documentation I should be looking at?

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

    Default Re: Attribute manager filtering download filenames.

    So, I've not looked at the impact of doing the following yet, as in how many cases this will affect, the potential pitfall, etc...

    Because the field is one that is already part of ZC, the only way to be more liberal about what is allowed (supporting the colon (:)) is to either add the colon to the regex allowed characters, or to remove the field from the list of fields to be processed by that regex pattern and add a pattern for that field as described in the Doc.

    To add the character, I would suggest that within admin/includes/classes/AdminRequestSanitizer.php search for filedirregex.

    Then within the regex pattern add the colon (:).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Dec 2006
    Location
    Connecticut
    Posts
    8
    Plugin Contributions
    0

    Default Re: Attribute manager filtering download filenames.

    Thanks, I made the change to admin/includes/classes/AdminRequestSanitizer.php and all seems to be working as expected. Just one more custom patch to add to the list when I update the site.

    Might I suggest that this information be posted for users of the
    Download Files From AWS module?
    Last edited by acmfox; 15 Feb 2018 at 09:17 PM.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Attribute manager filtering download filenames.

    Quote Originally Posted by acmfox View Post
    Thanks, I made the change to admin/includes/classes/AdminRequestSanitizer.php and all seems to be working as expected. Just one more custom patch to add to the list when I update the site.

    Might I suggest that this information be posted for users of the
    Download Files From AWS module?
    Go ahead and post in the forum thread for that module if there is one. :) as a member of the community your input counts too.

    I think in addition to this, there has been an item added to the wish list to support something like this, though the modifications needed to support it were not described. The addition of the colon (or other non-filename related delimiter) in the filename appears to be necessary.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Filtering Products by Size Attribute
    By largesse1 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 22 May 2011, 12:04 AM
  2. Can I add a custom attribute form, without using built in attribute manager?
    By infocom in forum Setting Up Categories, Products, Attributes
    Replies: 16
    Last Post: 12 Apr 2010, 10:17 AM
  3. A way of filtering by attribute?
    By ghurty in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Oct 2009, 10:34 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