Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 797 forks source link

Shortcode Embeds: Amazon Ads <Script> replaced with <a href> In Extra Theme #7476

Open BrookeDot opened 7 years ago

BrookeDot commented 7 years ago

When using the Extra-Ads widget from the Extra theme from Elegant Themes a conflict is present replacing <script> with <a href= I was not able to replicate this with the Text widget in Text Mode.

Steps to reproduce the issue

1.Install and activate Extra

  1. Install and activate Jetpack
  2. Insert the Ads - Extra widget into the site.
  3. Add the Amazon Ad code
    <div class="alignleft">
     <script type="text/javascript">
        amzn_assoc_ad_type = "banner";
    amzn_assoc_marketplace = "amazon";
    amzn_assoc_region = "US";
    amzn_assoc_placement = "assoc_banner_placement_default";
    amzn_assoc_campaigns = "amazonhomepage_2017";
    amzn_assoc_banner_type = "rotating";
    amzn_assoc_p = "9";
    amzn_assoc_width = "180";
    amzn_assoc_height = "150";
    amzn_assoc_tracking_id = "ewsrocessi-20";
    amzn_assoc_linkid = "####";
     </script>
     <script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;Operation=GetScript&amp;ID=OneJS&amp;WS=1"></script>
    </div>

Upon save watch the second <script> tag be replaced with: <a href="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&#038;Operation=GetScript&#038;ID=OneJS&#038;WS=1">//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&#038;Operation=GetScript&#038;ID=OneJS&#038;WS=1</a>

If you repeat steps 3-4 above with Enhanced Distribution turned off the second script tag remains.

What I expected

For the <script> tag to remain untouched upon saving the widget.

What happened instead

Final <script> tag gets replaced with href="

Screenshot

peek 2017-07-17 15-31

kraftbj commented 7 years ago

Can you upload the theme to MC PB (can DM me the link)? I don't immediately see anything in Jetpack that would be causing it so want to duplicate it. Thanks!

BrookeDot commented 7 years ago

Link sent :) I also tested with the latest version that was released today and still having the issue. I haven't looked into the widget itself more to see how the two are escaping together.

jeherve commented 7 years ago

Maybe related: #6809

stale[bot] commented 6 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.