Follow-up: Auto removal of HTML anchor tags in Cookie Notice Content
-
Hello WPeka,
Happy New Year!
I hope this message finds you well.
We would like to let you know that in the light of the recent updates (current version 3.6.8) a previously resolved issue has returned again.
Plugin versions 2.2.4 and 2.3.9 have successfully resolved the issue about HTML link tags getting removed from the Cookie Notice in the frontend. However, it seems that issue has returned again.
Here is an example “GDPR Message”:
<a href="https://www.example.com/">Example.com</a>, uses cookies in order to blah blah blah...
Unfortunately, the plugin strips off the link tag:
<a href="https://www.example.com/"></a>
With regard to my previously suggested fixes (here and here) , it is possible that the same approach might be eligible for the current version.
For example:
File: gdpr-cookie-consent/public/templates/skins/default.php
Line 33:Current code:
<div class="group-description" tabindex="0"><p class="gdpr"><?php echo $the_options['is_iabtcf_on'] ? $cookie_data['dash_notify_message_iabtcf']: esc_html__( $cookie_data['dash_notify_message'], '<a><br><em><strong><span><p><i><img><b><div><label>' ); ?>
Suggested modification:
<div class="group-description" tabindex="0"><p class="gdpr"><?php echo $the_options['is_iabtcf_on'] ? $cookie_data['dash_notify_message_iabtcf']: strip_tags(__( $cookie_data['dash_notify_message']), '<a><br><em><strong><span><p><i><img><b><div><label>' ); ?>
As previously, this suggestion employs again the PHP function
strip_tags()
instead ofesc_html()
to escape HTML tags in the frontend without compromising security.We would be grateful if you could re-implement the proposed fix or take any other action that remedies the issue in the next update to allow basic HTML markup the in consent message.
Thank you for your attention to this matter, and we look forward to your response.
Best regards,
George
- You must be logged in to reply to this topic.