Support » Plugin: Amazon Associates Link Builder » Problem with accents and the content_filter rendering

  • Hi !
    I noticed on my whole site that when I have an amazon link, all the accents and special characters are affected by wrong charset. It doesn’t affect page title part.

    Check for example.
    Title is “TEst et détails diplôme” and is rendered correctly
    Content contains “Détail de l’offre proposée” and is rendered ‘DéTAIL DE L’OFFRE PROPOSéE’ (if’s in H3)
    it’s because I have just after a simple link:

    <a href=",kitchen,147&sr=8-9&linkCode=li2&tag=frw-blog-21&linkId=cf78e38798c1ab389c36fb89376e461e" target="_blank" rel="noopener noreferrer"><img border="0" src="//"></a><img src="" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;">

    If I use the new Guttenberg tag, it’s OK but I can’t use it everywhere.

    <!-- wp:amazon-associates-link-builder/aalb-gutenberg-block {"shortCodeContent":"[amazon_link asins='B01JJ1VDQK' template='FW-ProductAd' store='frw-blog-art-21' marketplace='FR' link_id='c814875f-8a6e-4d93-8f84-c641af82fbcc']","searchKeyword":"B01JJ1VDQK card"} /-->


    after searching all around, I found the cause. It’s in /plugins/amazon-associates-link-builder/rendering/content_filter.php
    A regex searches the page content for amazon urls and makes some changes.
    In this file, and to match the example just above, If I change in
    private static $AMAZON_DOMAINS = array(......
    … the “” string to… lets say… “” then regex doesn’t match and my page is rendered correcty.

    I’m not a good php developper and I can’t find easily why this code changes the accents contened in the page:

            //Remove noreferrer form amazon anchor links
            foreach ( $anchor_node_list as $anchor_node ) {
                if ( $this->has_amazon_link( $anchor_node ) ) {
                    $this->remove_noreferrer( $anchor_node );
                    $content_updated = true;
            return $content_updated ? $document->saveHTML() : $content;

    I’m available for better testing
    best regard.

    • This topic was modified 2 years, 7 months ago by FrenchW.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter FrenchW


    Note : you may not see the problem on my site as I edited the file to get rid of the problem:

    `class Content_Filter {
    private static $AMAZON_DOMAINS = array(

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with accents and the content_filter rendering’ is closed to new replies.