• Resolved Lea

    (@leac)


    Hi

    We have a text widget with words from the glossary, but for some reason the closing quotation mark of the data-cmtooltip attribute in their tooltip is encoded as ", thus obfuscating all the following HTML.

    I found that the code creating the tooltip is in the glossaryFree.php file on line 2054, and if I change the quotation mark to a single quote and escape it, then it’s not encoded and the following HTML is fine.

    This is the code as it is in the plugin:

    $link_replace = '<a aria-describedby="tt" href="' . $permalink . '"' . $titleAttr . ' class="glossaryLink' . $additionalClass . '" data-cmtooltip="' . $tooltipContent . '" ' . $windowTarget . '>' . $titlePlaceholder . '</a>';

    And this is the code after my fix:

    $link_replace = '<a aria-describedby="tt" href="' . $permalink . '"' . $titleAttr . ' class="glossaryLink' . $additionalClass . '" data-cmtooltip=\'' . $tooltipContent . '\' ' . $windowTarget . '>' . $titlePlaceholder . '</a>';

    But of course I can’t make this change in the code since it would be overridden by the next plugin update.

    This happens only on one of our servers, a server that in on the Azure cloud and has PHP 7.4 on it. The bug doesn’t occur in our on premise servers running 7.3.

    Do you have any idea why this would happen and how I can solve it?

    • This topic was modified 3 years, 4 months ago by Lea.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    There’s actually a very easy fix for that – there’s an option “Move tooltip contents to footer” in the General Settings -> Debug.

    ps. Your change probably would have broken the HTML for the tooltips which would contain the apostrophe character (at least for some users).

    Thread Starter Lea

    (@leac)

    Thank you very much, that did solve the problem!

    And you’re right of course regarding tooltips with apostrophes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘quotation marks are wrongfully encoded, breaking the HTML’ is closed to new replies.