Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Ampersands in links and EZpages xHTML validation

    Hi All,
    Here's what's happening:
    I am using an EZpage for my faq page. There are many links on this page that have to use the ampersand "&" within the link.
    I can go through my EZpage and properly escape all the ampersands like so "&"
    Once I do that, I can validate the page, no problem.

    However, here is where the trouble starts:
    The next time I go to edit something on the EZpage, all the ampersands are unescaped again. Unless I go through and fix them all again, the page will not validate.

    It's apparent that the "amp;" is being properly stored, so I'm assuming that the "amp;" must be stripped when the data is retrieved from the database.

    The problem is, I don't know where to start looking. could someone point me to the right place?

    Here is a link to my faq page:
    http://thetoolspot.us/index.php?main_page=page&id=4
    If you scroll to the footer, you can find a link to the W3C validator.

    Thanks

  2. #2
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: Ampersands in links and EZpages xHTML validation

    It was becoming increasingly frustrating to have to recode all those ampersands every time I wanted to edit something on the FAQ page. So, after enough digging I finally found the source. Although after looking at the code, I'm still not sure why it was stripping the entities from the ampersands. In any case here is how I solved the problem in case anyone else is as retentive as I am and want their EZpages to validate:

    In admin/ezpages.php line 440
    I changed:
    PHP Code:
    echo zen_draw_textarea_field('pages_html_text''soft''100%''40'$ezInfo->pages_html_text); 
    to:
    PHP Code:
    echo zen_draw_textarea_field('pages_html_text''soft''100%''40'htmlspecialchars($ezInfo->pages_html_text)); 
    It seems to work fine now.

  3. #3
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Ampersands in links and EZpages xHTML validation

    Nice bit of troubleshooting and thanks for sharing.

    I'm sure those of us where Validation is important will find it very handy to apply your elegant solution.

  4. #4
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: Ampersands in links and EZpages xHTML validation

    Thanks, just trying to save someone else the trouble.

  5. #5
    Join Date
    Jun 2007
    Posts
    62
    Plugin Contributions
    0

    Default Re: Ampersands in links and EZpages xHTML validation

    Thanks for posting this, helped me figure out how to keep my entities for the ezPages titles. In admin/ezpages.php on line #383, I changed:

    Code:
    $ezInfo->pages_title,
    to:

    Code:
    htmlspecialchars($ezInfo->pages_title),
    Maybe that helps someone with a similar issue.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 20 May 2012, 01:54 PM
  2. Ampersands and validation on index page
    By DML73 in forum General Questions
    Replies: 0
    Last Post: 15 Mar 2010, 08:38 PM
  3. XHTML Validation
    By PGlad in forum General Questions
    Replies: 3
    Last Post: 30 Jun 2008, 09:29 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