gpt4 book ai didi

javascript - CF-Hash 属性和脚本神秘地添加到 mailto 链接

转载 作者:行者123 更新时间:2023-11-28 04:03:05 24 4
gpt4 key购买 nike

我有一个开发站点和一个生产站点:

我在底部有一个ma​​ilto邮箱链接,php源码如下:

           <section>
<h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
<p>Contact me today: <br/>
<a href='mailto:mail@example.com'>mail@example.com</a>
<br/>
<a href='tel:+13334445555'>333 444 5555</a>
</p>
</section>

我的开发站点一切正常,生成的html如下:

                <section>
<h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
<p>Contact me today: <br>
<a href="mailto:mail@example.com">mail@example.com</a>
<br>
<a href="tel:+13334445555">333 444 5555</a>
</p>
</section>

然后神秘地在我的生产站点上添加了一些 javascript 我的 mailto 链接(并且只有 mailto 链接,在这种情况下只是一个,但我添加了更多,脚本也添加到了它们)这是 html 输出在生产现场:

<section>
<h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
<p>Contact me today: <br>
<a href="mailto:mail@example.com">mail@example.com
<script cf-hash="f9e31" type="text/javascript">
/* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function() {for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n+=2)i=parseInt(a.substr(n,2),16)^r,e+=String.fromCharCode(i);e=document.createTextNode(e),c.parentNode.replaceChild(e,c)}}}catch(u){}}();/* ]]> */
</script>
</a>
<br>
<a href="tel:+13334445555">333 444 5555</a>
</p>
</section>

我检查了生产服务器上的代码,没有这个脚本。

可能发生了什么?

最佳答案

这与 ColdFusion 无关。在此代码中,cf-hashSCRIPT 标记(纯 HTML)的属性。搜索 'cf-hash="f9e31"会得到很多类似的代码。找到this link这表明它可能是 CloudFlare 电子邮件保护脚本。那将是在您的生产服务器上运行的东西,而不是在您的本地开发环境中。

关于javascript - CF-Hash 属性和脚本神秘地添加到 mailto 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27513190/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com