{"id":199489,"date":"2025-05-03T10:39:25","date_gmt":"2025-05-03T02:39:25","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199489\/"},"modified":"2025-05-03T10:39:25","modified_gmt":"2025-05-03T02:39:25","slug":"%e4%bf%ae%e6%94%b9ecshop%e6%9d%82%e5%bf%97%e7%bc%96%e8%be%91%e5%99%a8%e4%bf%9d%e5%ad%98%e8%b7%af%e5%be%84bug","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199489\/","title":{"rendered":"\u4fee\u6539ecshop\u6742\u5fd7\u7f16\u8f91\u5668\u4fdd\u5b58\u8def\u5f84bug"},"content":{"rendered":"<p>ecshop\u6742\u5fd7\u7ba1\u7406\u53d1\u9001\u4fc3\u9500\u90ae\u4ef6\u7684\u529f\u80fd\uff0c\u8fd9\u4e2a\u529f\u80fd\u5341\u5206\u7684\u5f3a\u5927\uff0c\u4f46\u4f7f\u7528\u7684\u9891\u7387\u8d8a\u5927\uff0c\u5c31\u4f1a\u8d8a\u53d1\u8d8a\u6709\u95ee\u9898\uff0c\u8fd9\u4e0d\uff0c\u521a\u53d1\u73b0\u4e86\u4e00\u4e2a\u5c0f\u5c0f\u7684 bug\uff0c\u5f97\u8d76\u7d27\u66f4\u6539\u8fc7\u6765\uff0c\u5c31\u662f\u6bcf\u6b21\u7f16\u8f91\u5185\u5bb9\u4fdd\u5b58\u7684\u65f6\u5019\uff0c\u90fd\u4f1a\u9ed8\u8ba4\u7684\u5c06 html \u90ae\u4ef6\u5185\u5bb9\u7684 src= \u66ff\u6362\u4e3a src=http:\/\/.$_SERVER[&#8220;HTTP_HOST&#8221;]\uff0c\u5f88\u663e\u7136\uff0cecshop \u4f7f\u7528\u4e86\u4e00\u4e2a .$_SERVER[&#8220;HTTP_HOST&#8221;] \u7684\u8def\u5f84\u51fd\u6570\uff0c\u4e5f\u5c31\u662f\u53c8\u65b0\u589e\u52a0\u4e86\u4e00\u4e2a\u7ad9\u70b9\u8def\u5f84\uff0c\u6240\u4ee5\u5bfc\u81f4\u6bcf\u6b21\u4fdd\u5b58\u90fd\u4f1a\u65b0\u52a0\u4e86\u4e2a\u8def\u5f84\uff0c\u8fd9\u6837\u5427\uff0c\u4e0b\u9762\u590f\u65e5\u535a\u5ba2\u4e3e\u4e2a\u4f8b\u5b50\u6765\u8bf4\u660e\u4e00\u4e0b\u3002   \u5f53\u6211\u4eec\u7b2c\u4e00\u6b21\u5728 html \u90ae\u4ef6\u4e2d\u4fdd\u5b58\u4e00\u4e2a\u56fe\u7247\u7684\u65f6\u5019\u8def\u5f84\u4e3a:   &nbsp;   src=\u201dhttps:\/\/www.ldhost.cn\/help\/test.jpg\u201d   &nbsp;   \u5f53\u7b2c\u4e8c\u6b21\u4fdd\u5b58 html \u90ae\u4ef6\u4e2d\u56fe\u7247\u7684\u65f6\u5019\uff0c\u8def\u5f84\u5c31\u53d8\u4e3a\u4e86\u5982\u4e0b:   &nbsp;   src=\u201dhttp:\/\/www.ldhost.cnhttp:\/\/www.ldhost.cnhttps:\/\/www.ldhost.cn\/help\/test.jpg\u201d   &nbsp;   \u8fd9\u5c31\u662f\u5c0f\u7684 bug\u4e86\uff0c\u51ed\u767d\u65e0\u6545\u7684\u591a\u4e86\u600e\u4e48\u4e00\u4e2a\u8def\u5f84\uff0c\u8fd9\u4e2a\u4e00\u5b9a\u662f\u8981\u53bb\u6389\u7684\uff0c\u5b9e\u9645\u5c31\u662f\u53bb\u6389 $_SERVER[&#8220;HTTP_HOST&#8221;] \u8fd9\u4e2a\u51fd\u6570\u4e86\u3002   &nbsp;   \u6253\u5f00 \/admin\/magazine_list.php \u6587\u4ef6\uff0c\u67e5\u627e\u5982\u4e0b\u7684\u4ee3\u7801:   &nbsp;   elseif ($_POST[&#8216;step&#8217;] == 2)   {   $magazine_name = trim($_POST[&#8216;magazine_name&#8217;]);   $magazine_content = trim($_POST[&#8216;magazine_content&#8217;]);   $magazine_content = str_replace(&#8216;src=\\&#8221;&#8216;,&#8217;src=\\&#8221;http:\/\/&#8217;.$_SERVER[&#8216;HTTP_HOST&#8217;],$magazine_content);   $time = gmtime();   $db-&amp;gt;query(&#8220;UPDATE &#8221; . $ecs-&amp;gt;table(&#8216;mail_templates&#8217;) . &#8221; SET is_html = 1, template_subject = &#8216;$magazine_name&#8217;, template_content = &#8216;$magazine_content&#8217;, last_modify = &#8216;$time&#8217; WHERE type = &#8216;magazine&#8217; AND template_id = &#8216;$id'&#8221;);   $links[] = array(&#8216;text&#8217; =&amp;gt; $_LANG[&#8216;magazine_list&#8217;], &#8216;href&#8217; =&amp;gt; &#8216;magazine_list.php?act=list&#8217;);   sys_msg($_LANG[&#8216;edit_ok&#8217;], 0, $links);   }   &nbsp;   \u6ce8\u91ca\u6216\u8005\u5220\u9664\u6389\u4ee3\u7801\u4e2d $magazine_content = str_replace(\u2018src=\\\u201d\u2018,\u2019src=\\\u201dhttp:\/\/\u2019.$_SERVER[&#8216;HTTP_HOST&#8217;],$magazine_content); \u8fd9\u4e00\u53e5\uff0c\u4e5f\u5c31\u662f\u4fee\u6539\u6210\u5982\u4e0b\u7684\u5b8c\u6574\u4ee3\u7801\u5373\u53ef:   &nbsp;   elseif ($_POST[&#8216;step&#8217;] == 2)   {   $magazine_name = trim($_POST[&#8216;magazine_name&#8217;]);   $magazine_content = trim($_POST[&#8216;magazine_content&#8217;]);   \/\/$magazine_content = str_replace(&#8216;src=\\&#8221;&#8216;,&#8217;src=\\&#8221;http:\/\/&#8217;.$_SERVER[&#8216;HTTP_HOST&#8217;],$magazine_content); \/\/\u7981\u6b62\u4fdd\u5b58\u65f6\u4fee\u6539\u8def\u5f84   $time = gmtime();   $db-&amp;gt;query(&#8220;UPDATE &#8221; . $ecs-&amp;gt;table(&#8216;mail_templates&#8217;) . &#8221; SET is_html = 1, template_subject = &#8216;$magazine_name&#8217;, template_content = &#8216;$magazine_content&#8217;, last_modify = &#8216;$time&#8217; WHERE type = &#8216;magazine&#8217; AND template_id = &#8216;$id'&#8221;);   $links[] = array(&#8216;text&#8217; =&amp;gt; $_LANG[&#8216;magazine_list&#8217;], &#8216;href&#8217; =&amp;gt; &#8216;magazine_list.php?act=list&#8217;);   sys_msg($_LANG[&#8216;edit_ok&#8217;], 0, $links);   }   &nbsp;   \u597d\u4e86\uff0c\u8fd9\u4e2a\u65f6\u5019\u518d\u53bb\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u7b2c\u4e00\u6b21\u4fdd\u5b58\u548c\u7b2c\u4e8c\u6b21\u4fdd\u5b58\u7684\u683c\u5f0f\u8def\u5f84\u5e94\u8be5\u662f\u4e00\u6837\u7684\u3002  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u6742\u5fd7\u7ba1\u7406\u53d1\u9001\u4fc3\u9500\u90ae\u4ef6&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199489","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199489"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199489\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}