Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag [Done v1.5.5f] EZ Pages "Internal" Links output with & amp ; in catalog

    I am running Zen Cart 1.5.5e and when I edit an EZ Page and enter a url into 'Internal Link URL:' like index.php?main_page=index&cPath=64 it changes the url in the browser address bar to 'index.php?main_page=index&cPath=64' which is incorrect. The url in the EZ Pages admin screen remains as index.php?main_page=index&cPath=64 but it is changing & to & on the front end URL

    This is happening on two different servers running the site identical in different development hosting spaces.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Interesting. The problem is masked in the Admin by virtue of properly translating those symbols for display.

    But in those cases it's saved in the db as entities, which appears to be why it's being output catalog-side as entities. Need to investigate further.
    .

    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 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Ok, so are you working at it?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    wilt and I are looking at code.

    It doesn't seem to be a sanitizer issue.

    Rather it seems to be something with the way zen_href_link treats embedded ampersands when passing a complete URL instead of passing the page name with parameters as a secondary value. And zen_href_link is being used to output those internal links.

    I'm puzzled why this hasn't come up before. And in all earlier versions. Just with "internal" links that contain & symbols.
    .

    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
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    I'm fairly sure I used '&' in url's in earlier versions on EZ Pages...but then I have done so much work I can't say for absolute sure without going through my previous work. I take it I have just undone a can of worms?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Quote Originally Posted by Nick1973 View Post
    I take it I have just undone a can of worms?
    Yup.
    One that doesn't have a quick easy fix either.
    .

    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.

  7. #7
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Quote Originally Posted by DrByte View Post
    Yup.
    One that doesn't have a quick easy fix either.
    Not pressuring, but just wondered if you had got anywhere with this? And any idea roughly when it will be fixed?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Quote Originally Posted by Nick1973 View Post
    Not pressuring, but just wondered if you had got anywhere with this? And any idea roughly when it will be fixed?
    While I would say that less than a day's time doesn't jive with the below:
    Quote Originally Posted by DrByte View Post
    Yup.
    One that doesn't have a quick easy fix either.
    I did come across two different "quick fixes" (not sure of the overall impact, but seems to address this issue for the store until a proper solution is developed). Ie. This really is a patch or a hack.

    One was to use the admin sanitizer for alt_url to go through the PRODUCT_DESC_REGEX. Reason considered was that a product description may have a url in it and likely be handled "properly" and because sending it through PRODUCT_URL_REGEX didn't improve the situation.

    New file:
    admin/includes/extra_datafiles/ez_pages_url_sanitize.php
    Code:
    $sanitizer = AdminRequestSanitizer::getInstance();
    $group = array(
     'alt_url' => array(
            'sanitizerType' => 'PRODUCT_DESC_REGEX',
            'method' => 'post',
            'pages' => array('ezpages')
            )
    );
    $sanitizer->addComplexSanitization($group);

    The other was in includes/function/functions_ezpages.php after $ez_pages_alturl was assigned to use:
    Code:
    $ez_pages_alturl = strsub('&', '&', $ez_pages_alturl);
    It doesn't fix zen_href_link by any means, but it provides to that function a url that doesn't already have the ampersand 'sanitized'.

    Btw, either of the above fixed the "immediate" issue, but doesn't require both. There may be other sanitizer types that would work, but those were the ones that seemed logical to attempt. I think I tried one other like WORDS_AND_SYMBOLS_REGEX, or maybe just thought about it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Re: EZ Pages "Internal" Links output with & amp ; in catalog

    Quote Originally Posted by mc12345678 View Post
    While I would say that less than a day's time doesn't jive with the below:


    I did come across two different "quick fixes" (not sure of the overall impact, but seems to address this issue for the store until a proper solution is developed). Ie. This really is a patch or a hack.

    One was to use the admin sanitizer for alt_url to go through the PRODUCT_DESC_REGEX. Reason considered was that a product description may have a url in it and likely be handled "properly" and because sending it through PRODUCT_URL_REGEX didn't improve the situation.

    New file:
    admin/includes/extra_datafiles/ez_pages_url_sanitize.php
    Code:
    $sanitizer = AdminRequestSanitizer::getInstance();
    $group = array(
     'alt_url' => array(
            'sanitizerType' => 'PRODUCT_DESC_REGEX',
            'method' => 'post',
            'pages' => array('ezpages')
            )
    );
    $sanitizer->addComplexSanitization($group);

    The other was in includes/function/functions_ezpages.php after $ez_pages_alturl was assigned to use:
    Code:
    $ez_pages_alturl = strsub('&amp;', '&', $ez_pages_alturl);
    It doesn't fix zen_href_link by any means, but it provides to that function a url that doesn't already have the ampersand 'sanitized'.

    Btw, either of the above fixed the "immediate" issue, but doesn't require both. There may be other sanitizer types that would work, but those were the ones that seemed logical to attempt. I think I tried one other like WORDS_AND_SYMBOLS_REGEX, or maybe just thought about it.
    Ok thank you for this. I am nearing completion of a project which will require the fix. It has to be done by Friday 21st April 2017 which is why I needed something fairly quickly. Very greatful for these and hopefully they will 'sort of' fix it for the time being. I will come back to you and let you know.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  10. #10
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: EZ Pages "Internal" Links output with & amp ; in catalog

    The first fix worked for me:

    New file:
    admin/includes/extra_datafiles/ez_pages_url_sanitize.php

    with this code:

    Code:
    <?php $sanitizer = AdminRequestSanitizer::getInstance();
    $group = array(
     'alt_url' => array(
            'sanitizerType' => 'PRODUCT_DESC_REGEX',
            'method' => 'post',
            'pages' => array('ezpages')
            )
    );
    $sanitizer->addComplexSanitization($group); ?>
    The second fix failed. This will sort things out for now.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. EZ pages internal links
    By m.digregorio in forum General Questions
    Replies: 6
    Last Post: 7 Aug 2013, 06:54 PM
  2. Ez Pages + Internal Links
    By autouk in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Apr 2008, 01:58 PM
  3. Ez Pages + Internal Links
    By autouk in forum General Questions
    Replies: 0
    Last Post: 23 Apr 2008, 01:57 PM
  4. Replies: 1
    Last Post: 11 Jun 2007, 05:33 PM
  5. EZ-Pages TOC & Internal Links
    By MattC in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Nov 2006, 07:21 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