{"id":27870,"date":"2024-11-24T15:52:51","date_gmt":"2024-11-24T07:52:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27870\/"},"modified":"2024-11-24T15:52:51","modified_gmt":"2024-11-24T07:52:51","slug":"%e5%a6%82%e4%bd%95%e6%ad%a3%e5%88%99%e5%8c%b9%e9%85%8d%e5%b8%a6%e6%9c%89-%e5%ad%97%e7%ac%a6%e7%9a%84-script-%e6%a0%87%e7%ad%be%e5%86%85%e5%ae%b9%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27870\/","title":{"rendered":"\u5982\u4f55\u6b63\u5219\u5339\u914d\u5e26\u6709 > \u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173132533619337.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u6b63\u5219\u5339\u914d\u5e26\u6709 &gt; \u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u6b63\u5219\u5339\u914d\u5e26\u6709 &gt; \u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f\u63d2\u56fe\" \/> \u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f &#8221; \/&gt;<\/p>\n<p><strong>\u6b63\u5219\u5b8c\u6574\u5339\u914d script \u6807\u7b7e\u4e2d\u95f4\u5185\u5bb9<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong> \u5982\u4f55\u6b63\u5219\u6355\u83b7 script \u6807\u7b7e\u4e2d\u95f4\u90e8\u5206\u7684\u5185\u5bb9\uff0c\u5373\u4f7f\u5c5e\u6027\u63d2\u5165\u4e86 &gt; \u5b57\u7b26\uff1f<\/p>\n<p><strong>\u89e3\u51b3\uff1a<\/strong><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4f18\u5316\u540e\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a<\/p>\n<pre>\/(&lt;script([^\"&lt;&gt;]+|\"[^\"]*\")*&gt;)([sS]*?)(&lt;\/script&gt;)\/g<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5206\u6790\uff1a<\/strong><\/p>\n<p>\u6b64\u6b63\u5219\u7531\u4ee5\u4e0b\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n<ol>\n<li> <strong>(.<em>?)\uff1a<\/em><\/strong> \u5339\u914d\u975e\u5f15\u53f7\u5b57\u7b26\uff08<sup><\/sup>\uff09\u6216\u5f15\u53f7\u5305\u56f4\u7684\u5b57\u7b26\uff08&#8221;<sup><\/sup>&#8220;\uff09\uff0c\u4ece\u800c\u6392\u9664\u5f15\u53f7\u7684\u5f71\u54cd\u3002<\/li>\n<li> <strong>([sS]*?)\uff1a<\/strong> \u5339\u914d script \u6807\u7b7e\u4e4b\u95f4\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5305\u62ec\u6362\u884c\u7b26\u3002<\/li>\n<li> <strong>()\uff1a<\/strong> \u5339\u914d\u5173\u95ed script \u6807\u7b7e\u3002<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b PHP \u4ee3\u7801\uff1a<\/p>\n<pre>&lt;script src=\"static\/js\/jsencrypt.js?v=&lt;?= WEB_VERSION ?&gt;\"&gt;&lt;\/script&gt;\n&lt;script src=\"static\/js\/jquery.form.js?v=&lt;?= WEB_VERSION ?&gt;\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\"&gt;\n    var a = 1;\n    var b = 2;\n&lt;\/script&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f7f\u7528\u4e0a\u8ff0\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u5339\u914d\u7b2c\u4e09\u4e2a script \u6807\u7b7e\u5185\u7684\u5185\u5bb9\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre>var a = 1;\nvar b = 2;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<hr>\n<ol>\n<li>&#8221;  <\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u6b63\u5219\u5339\u914d\u5e26\u6709 &gt; \u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b57\u7b26\u7684 script \u6807\u7b7e\u5185\u5bb9\uff1f &#8221; \/&gt; \u6b63\u5219\u5b8c\u6574\u5339\u914d script \u6807\u7b7e\u4e2d\u95f4\u5185\u5bb9 \u95ee\u9898\uff1a \u5982\u4f55\u6b63\u5219\u6355\u83b7 script \u6807\u7b7e\u4e2d\u95f4\u90e8\u5206\u7684\u5185\u5bb9\uff0c\u5373\u4f7f\u5c5e\u6027\u63d2\u5165\u4e86 &gt; \u5b57\u7b26\uff1f \u89e3\u51b3\uff1a \u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4f18\u5316\u540e\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a \/(&lt;script([^&#8221;&lt;&gt;]+|&#8221;[^&#8221;]*&#8221;)*&gt;)([sS]*?)(&lt;\/script&gt;)\/g \u767b\u5f55\u540e\u590d\u5236 \u5206\u6790\uff1a \u6b64\u6b63\u5219\u7531\u4ee5\u4e0b\u90e8\u5206\u7ec4\u6210\uff1a (.?)\uff1a \u5339\u914d\u975e\u5f15\u53f7\u5b57\u7b26\uff08\uff09\u6216\u5f15\u53f7\u5305\u56f4\u7684\u5b57\u7b26\uff08&#8221;&#8220;\uff09\uff0c\u4ece\u800c\u6392\u9664\u5f15\u53f7\u7684\u5f71\u54cd\u3002 ([sS]*?)\uff1a \u5339\u914d script \u6807\u7b7e\u4e4b\u95f4\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5305\u62ec\u6362\u884c\u7b26\u3002 ()\uff1a \u5339\u914d\u5173\u95ed script \u6807\u7b7e\u3002 \u793a\u4f8b\uff1a \u4ee5\u4e0b PHP \u4ee3\u7801\uff1a &lt;script src=&#8221;static\/js\/jsencrypt.js?v=&lt;?= WEB_VERSION ?&gt;&#8221;&gt;&lt;\/script&gt; &lt;script src=&#8221;static\/js\/jquery.form.js?v=&lt;?= WEB_VERSION ?&gt;&#8221;&gt;&lt;\/script&gt; &lt;script type=&#8221;text\/javascript&#8221;&gt; var a = 1; var b = 2; &lt;\/script&gt; \u767b\u5f55\u540e\u590d\u5236 \u4f7f\u7528\u4e0a\u8ff0\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u5339\u914d\u7b2c\u4e09\u4e2a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27870","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27870"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27870\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}