{"id":485,"date":"2023-03-01T21:23:35","date_gmt":"2023-03-01T13:23:35","guid":{"rendered":"http:\/\/www.gaoxigang.com\/?p=485"},"modified":"2023-03-01T21:23:35","modified_gmt":"2023-03-01T13:23:35","slug":"%e6%80%8e%e4%b9%88%e8%ae%a9phpcms%e6%94%af%e6%8c%81https","status":"publish","type":"post","link":"https:\/\/www.gaoxigang.com\/index.php\/2023\/03\/01\/%e6%80%8e%e4%b9%88%e8%ae%a9phpcms%e6%94%af%e6%8c%81https\/","title":{"rendered":"\u600e\u4e48\u8ba9phpcms\u652f\u6301https"},"content":{"rendered":"<p class=\"introduction\">\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u201c\u600e\u4e48\u8ba9phpcms\u652f\u6301https\u201d\uff0c\u5728\u65e5\u5e38\u64cd\u4f5c\u4e2d\uff0c\u76f8\u4fe1\u5f88\u591a\u4eba\u5728\u600e\u4e48\u8ba9phpcms\u652f\u6301https\u95ee\u9898\u4e0a\u5b58\u5728\u7591\u60d1\uff0c\u5c0f\u7f16\u67e5\u9605\u4e86\u5404\u5f0f\u8d44\u6599\uff0c\u6574\u7406\u51fa\u7b80\u5355\u597d\u7528\u7684\u64cd\u4f5c\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u89e3\u7b54\u201d\u600e\u4e48\u8ba9phpcms\u652f\u6301https\u201d\u7684\u7591\u60d1\u6709\u6240\u5e2e\u52a9\uff01\u63a5\u4e0b\u6765\uff0c\u8bf7\u8ddf\u7740\u5c0f\u7f16\u4e00\u8d77\u6765\u5b66\u4e60\u5427\uff01<\/p>\n<p><strong>1\u3001\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\u597dphpcms\uff0c\u5219\u9700\u8981\u5bf9caches\/configs\/system.php\u4e2d\u7684\u914d\u7f6e\u9009\u9879\u505a\u66ff\u6362\uff0c<\/strong>\u5c06&#8221;http:\/\/&#8221;\u5168\u90e8\u66ff\u6362\u4e3a&#8221;https:\/\/&#8221;\u3002\u5982\u6709\u5fc5\u8981\uff0c\u6570\u636e\u5e93\u4e2d\u5df2\u5b58\u5728\u7684\u94fe\u63a5\u4e5f\u8981\u5b8c\u5168\u66ff\u6362\u4e3ahttps\u5f00\u5934\u3002<\/p>\n<p><strong>2\u3001\u7a0b\u5e8f\u4fee\u6539\u90e8\u5206\uff1a<\/strong><br data-filtered=\"filtered\" \/><strong>\uff081\uff09<\/strong>\u4fee\u6539phpcms\/modules\/admin\/site.php \u5927\u7ea645\u884c\u548c128\u884c\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs ruby\">(<span class=\"hljs-string\">'\/http:\\\/\\\/(.+)\\\/$\/i'<\/span>,\u00a0$domain))<\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs ruby\">(<span class=\"hljs-string\">'\/(http|https):\\\/\\\/(.+)\\\/$\/i'<\/span>,\u00a0$domain))<\/pre>\n<p><strong>\uff082\uff09<\/strong>\u4fee\u6539phpcms\/modules\/admin\/templates\/setting.tpl.php \u5927\u7ea618\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs coffeescript\">http:\\<span class=\"hljs-regexp\">\/\\\/(.+)[^\/<\/span>]$<\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs coffeescript\">http[s]?:\\<span class=\"hljs-regexp\">\/\\\/(.+)[^\/<\/span>]$<\/pre>\n<p><strong>\uff083\uff09<\/strong>\u4fee\u6539phpcms\/modules\/admin\/templates\/site_add.tpl.php \u5927\u7ea613\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs properties\"><span class=\"hljs-attr\">http<\/span>:<span class=\"hljs-string\">\\\/\\\/(.+)\\\/$<\/span><\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs scss\">http<span class=\"hljs-selector-attr\">[s]<\/span>?:\\\/\\\/(.+)\\\/$<\/pre>\n<p><strong>\uff084\uff09<\/strong>\u4fee\u6539phpcms\/modules\/admin\/templates\/site_edit.tpl.php \u5927\u7ea611\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs properties\"><span class=\"hljs-attr\">http<\/span>:<span class=\"hljs-string\">\\\/\\\/(.+)\\\/$<\/span><\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs scss\">http<span class=\"hljs-selector-attr\">[s]<\/span>?:\\\/\\\/(.+)\\\/$<\/pre>\n<p><strong>\uff085\uff09<\/strong>\u4fee\u6539phpcms\/modules\/link\/index.php \u5927\u7ea641\u884c\u548c51\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs makefile\"><span class=\"hljs-section\">\/^http:\\\/\\\/(.*)\/i<\/span><\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs makefile\"><span class=\"hljs-section\">\/^http[s]?:\\\/\\\/(.*)\/i<\/span><\/pre>\n<p><strong>\uff086\uff09<\/strong>\u4fee\u6539phpcms\/modules\/link\/templates\/link_add.tpl.php \u5927\u7ea610\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs xml\">^http:\\\/\\\/[A-Za-z0-9]+\\.[A-Za-z0-9]+[\\\/=\\?%\\-&amp;]*([^<span class=\"hljs-tag\">&lt;&gt;<\/span>])*$<\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs scss\">^http<span class=\"hljs-selector-attr\">[s]<\/span>?:\\\/\\\/[A-Za-z0-<span class=\"hljs-number\">9<\/span>]+\\.[A-Za-z0-<span class=\"hljs-number\">9<\/span>]+[\\\/=\\?%\\-&amp;]*([^&lt;&gt;])*$<\/pre>\n<p><strong>\uff087\uff09<\/strong>\u4fee\u6539phpcms\/modules\/link\/templates\/link_edit.tpl.php \u5927\u7ea611\u884c\u4e2d\u7684\u6b63\u5219<\/p>\n<pre class=\"hljs xml\">^http:\\\/\\\/[A-Za-z0-9]+\\.[A-Za-z0-9]+[\\\/=\\?%\\-&amp;]*([^<span class=\"hljs-tag\">&lt;&gt;<\/span>])*$<\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs scss\">^http<span class=\"hljs-selector-attr\">[s]<\/span>?:\\\/\\\/[A-Za-z0-<span class=\"hljs-number\">9<\/span>]+\\.[A-Za-z0-<span class=\"hljs-number\">9<\/span>]+[\\\/=\\?%\\-&amp;]*([^&lt;&gt;])*$<\/pre>\n<p>\u4e25\u683c\u6309\u7167\u4ee5\u4e0a\u6b65\u9aa4\u4fee\u6539\u540e\uff0c\u6ce8\u518c\u7528\u6237 \u5e10\u53f7\u767b\u5f55\u7b49\u64cd\u4f5c\u5b8c\u5168\u6b63\u5e38 \u548cPHPSSO\u901a\u4fe1\u5b8c\u5168\u6b63\u5e38\uff0c\u540e\u53f0\u6dfb\u52a0\u4fe1\u606f\u548c\u524d\u53f0\u94fe\u63a5URL\u5b8c\u5168\u6b63\u5e38<\/p>\n<p>\u6ce8\u610f\uff1a<br data-filtered=\"filtered\" \/>\u00a0 \u00a0 a.\u5982\u6ce8\u518c\u7528\u6237\u63d0\u793a\u2018\u64cd\u4f5c\u5931\u8d25\u2019\uff0c\u8bf7\u5728\u540e\u53f0\u4f1a\u5458\u6a21\u5757\u8bbe\u7f6e\u4e2d\u5173\u95ed\u2018\u6ce8\u518c\u65f6\u53ef\u9009\u4f1a\u5458\u6a21\u578b\u2019\u6216\u8005\u4fdd\u8bc1\u4f1a\u5458\u4e0d\u5c11\u4e8e\u4e24\u4e2a\u4f1a\u5458\u6a21\u578b<\/p>\n<p>b.\u5728PHP5.6\u6216\u4ee5\u4e0a\u7684PHP\u7248\u672c\u4e2d\u4f1a\u51fa\u73b0\u548cPHPSSO\u65e0\u6cd5\u6b63\u5e38\u901a\u4fe1\u7684\u60c5\u51b5\uff0c\u56e0\u4e3aPHP5.6\u53ca\u4ee5\u4e0afsockopen\u548cfile_get_contents\u7b49\u51fd\u6570openssl\u9700\u8981\u9a8c\u8bc1\u76ee\u6807\u7684<a title=\"SSL\u8bc1\u4e66\" href=\"https:\/\/www.yisu.com\/ssl\/\" target=\"_blank\" rel=\"noopener\">SSL\u8bc1\u4e66<\/a>\u662f\u5426\u53ef\u4fe1\uff0c\u9700\u8981\u5b89\u88c5openssl\u6839\u8bc1\u4e66\u624d\u53ef\u4ee5\uff0c\u5426\u5219openssl\u4f1a\u62a5\u8b66\u544a\u4fe1\u606f \u8bc1\u4e66\u9a8c\u8bc1\u5931\u8d25\uff01<br data-filtered=\"filtered\" \/>\u00a0 \u00a0 \u5982\u9700\u5728php5.6\u6216\u4ee5\u4e0a\u7248\u672c\u4e2d\u4f7f\u7528HTTPS\u7684\u8bf7\u53c2\u9605PHP\u5b98\u65b9\u6709\u5173php5.6\u548copenssl\u7684\u8d44\u6599http:\/\/php.net\/manual\/en\/migration56.openssl.php<\/p>\n<p><strong>3\u3001\u7ecf\u8fc7\u4e0a\u9762\u4fee\u6539\u540e\uff0cphpcms\u4e2d\u7684\u5185\u5bb9\u53ef\u901a\u8fc7https\u8bbf\u95ee\uff0c\u4f46\u5206\u9875\u51fa\u73b0\u9519\u8bef\u3002\u89e3\u51b3\u65b9\u6cd5\u4e3a\uff1a<\/strong><br data-filtered=\"filtered\" \/>\u00a0\u00a0 \u00a0\u6253\u5f00\u6587\u4ef6 phpcms\\libs\\functions \\global.func.php \uff0c\u627e\u5230738\u884c\u7684\u4f4d\u7f6e\uff1a<\/p>\n<pre class=\"hljs php\">$url\u00a0=\u00a0str_replace(<span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">'http:\/\/'<\/span>,<span class=\"hljs-string\">'\/\/'<\/span>,<span class=\"hljs-string\">'~'<\/span>),\u00a0<span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">'~'<\/span>,<span class=\"hljs-string\">'\/'<\/span>,<span class=\"hljs-string\">'http:\/\/'<\/span>),\u00a0$url);<\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre class=\"hljs php\">$url\u00a0=\u00a0str_replace(<span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">'https:\/\/'<\/span>,<span class=\"hljs-string\">'\/\/'<\/span>,<span class=\"hljs-string\">'~'<\/span>),\u00a0<span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">'~'<\/span>,<span class=\"hljs-string\">'\/'<\/span>,<span class=\"hljs-string\">'https:\/\/'<\/span>),\u00a0$url);<\/pre>\n<p><br data-filtered=\"filtered\" \/>\u7ecf\u8fc7\u4ee5\u4e0a\u4e09\u6b65\uff0cphpcms\u5b8c\u7f8e\u652f\u6301https\uff0c\u7ed3\u5408\u9875\u9762\u9759\u6001\u5316\u548curl\u4f2a\u9759\u6001\u89c4\u5219\uff0c\u4eb2\u6d4b\u9759\u6001\u9875\u9762\u4e5f\u53ef\u7528https\u3002<br data-filtered=\"filtered\" \/><strong>\u6b64\u65f6\u7684\u7f51\u7ad9\u5b9e\u9645\u4e0a\u901a\u8fc7http\u548chttps\u90fd\u80fd\u8bbf\u95ee\u3002<\/strong><\/p>\n<h5><strong>\u8865\u5145\uff1a<\/strong><\/h5>\n<p>\u7ecf\u8fc7\u4ee5\u4e0a\u6240\u6709\u6b65\u9aa4\u540e\uff0c\u51fa\u73b0\u65b0\u7684\u95ee\u9898\uff1a\u65b0\u95fb\u5217\u8868\u9875\u9762\u70b9\u51fb\u6807\u9898\u8df3\u8f6c\u7684URL\u4f1a\u91cd\u590d\u5e26\u6709\u7f51\u7ad9\u57df\u540d\u3002<strong>\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b\uff1a<\/strong><br data-filtered=\"filtered\" \/>\u6253\u5f00 phpcms\\modules\\content\\templates\\content_list.tpl.php\uff0c\u627e\u523097\u884c\u7684\u4f4d\u7f6e\uff1a<\/p>\n<pre class=\"hljs ruby\">strpos($r[<span class=\"hljs-string\">'url'<\/span>],<span class=\"hljs-string\">'http:\/\/'<\/span>)!==<span class=\"hljs-literal\">false<\/span><\/pre>\n<p>\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre class=\"hljs ruby\">strpos($r[<span class=\"hljs-string\">'url'<\/span>],<span class=\"hljs-string\">'https:\/\/'<\/span>)!==<span class=\"hljs-literal\">false<\/span><\/pre>\n<p class=\"introduction\">\u5230\u6b64\uff0c\u5173\u4e8e\u201c\u600e\u4e48\u8ba9phpcms\u652f\u6301https\u201d\u7684\u5b66\u4e60\u5c31\u7ed3\u675f\u4e86\uff0c\u5e0c\u671b\u80fd\u591f\u89e3\u51b3\u5927\u5bb6\u7684\u7591\u60d1\u3002\u7406\u8bba\u4e0e\u5b9e\u8df5\u7684\u642d\u914d\u80fd\u66f4\u597d\u7684\u5e2e\u52a9\u5927\u5bb6\u5b66\u4e60\uff0c\u5feb\u53bb\u8bd5\u8bd5\u5427\uff01<\/p>\n<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.yisu.com\/zixun\/594345.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u201c\u600e\u4e48\u8ba9phpcms\u652f\u6301https\u201d\uff0c\u5728\u65e5\u5e38\u64cd\u4f5c\u4e2d\uff0c\u76f8\u4fe1\u5f88\u591a\u4eba\u5728\u600e\u4e48\u8ba9phpcms\u652f\u6301http [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[12],"class_list":["post-485","post","type-post","status-publish","format-standard","hentry","category-biji","tag-phpcms"],"_links":{"self":[{"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/posts\/485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":0,"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaoxigang.com\/index.php\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}