• Resolved CRCulver

    (@crculver)


    When creating Amazon links, the plugin does not change all instances of & in the URL to &. This breaks HTML validation. As the W3C validator will report:

    `Error Line 82, Column 84: & did not start a character reference. (& probably should have been escaped as &.)

    …azon.com/gp/product/1841623415?ie=UTF8&linkCode=as2&camp=1634&creative=6738&ta…`

    Pretty much all browsers nowadays know that & in an URL should be processed as &, and so there would be no drawback to fixing this bug. Many website owners rely on having valid HTML.

    https://ww.wp.xz.cn/plugins/amazon-link/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    I’ll look into it and get it sorted for the next version.

    Thanks for finding and bothering to post the bug!

    Paul

    Plugin Author paulstuttard

    (@paulstuttard)

    If you want a quick fix to the Amazon Links you can add this to the plugin initialisation, or anywhere convenient:

    add_filter( 'amazon_link_url',                     'esc_url', 21, 1);

    Note you will have to manually convert the ‘&’ characters in the templates – e.g. for the impression tracking links.

    Paul

    Plugin Author paulstuttard

    (@paulstuttard)

    The latest Version (3.2.2) now escapes the Link URLs.

    The templates still need to update the templates though.

    Paul

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin does not escape instances of &’ is closed to new replies.