Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    Join Date
    Jul 2012
    Posts
    12,554
    Plugin Contributions
    16

    Default 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('&', '&', $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.
    Okay, so I apparently had 1) mixed tests up and 2) used an incorrect function. Did find a little more about why some of this could take some time to resolve as a broad spectrum ez-pages "issue". For example the ez-pages code (at least that I'm looking at) doesn't use the functions_ezpages link function (zen_ez_pages_link) to retrieve/return the link. So there are more locations in which the code would need to be changed: for example to name one includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php

    add in 2 places the following:

    Code:
    $page_query->fields['alt_url'] = str_replace('&', '&', $page_query->fields['alt_url']);
    in the internal and external link cases around lines 38 and 45.

    The other in includes/function/functions_ezpages.php after $ez_pages_alturl was assigned should have been:
    Code:
    $ez_pages_alturl = str_replace('&', '&', $ez_pages_alturl);
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  2. #12
    Join Date
    Jan 2004
    Posts
    64,931
    Blog Entries
    7
    Plugin Contributions
    220

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

    .

    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.

 

 
Page 2 of 2 FirstFirst 12

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