\u6f0f\u6d1e\u63cf\u8ff0\uff1a\u5728Discuz\u4e2d\uff0cuc_key\u662fUC\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u901a\u4fe1\u7684\u901a\u4fe1\u5bc6\u94a5\uff0cdiscuz\u4e2d\u7684\/api\/uc.php\u5b58\u5728\u4ee3\u7801\u5199\u5165\u6f0f\u6d1e\uff0c\u5bfc\u81f4\u9ed1\u5ba2\u53ef\u5199\u5165\u6076\u610f\u4ee3\u7801\u83b7\u53d6uckey\uff0c\u6700\u7ec8\u8fdb\u5165\u7f51\u7ad9\u540e\u53f0\uff0c\u9020\u6210\u6570\u636e\u6cc4\u6f0f\u3002\u60a8\u4e5f\u53ef\u4ee5\u767b\u5f55\u5b98\u65b9\u7f51\u7ad9\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u89e3\u51b3\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u89e3\u51b3\u529e\u6cd5\uff1a\u6253\u5f00\/api\/uc.php\u4fee\u6539\u4ee5\u4e0b3\u90e8\u5206\u5185\u5bb9<\/p>\n
1.\u7b2c\u4e00\u5904\u4fee\u6539<\/p>\n
\r\n$data = array();\r\nif (is_array($post)) {\r\n foreach($post as $k = & gt; $v) {\r\n \/\/dz uc-key\u4fee\u6539\u5f00\u59cb\r\n if (substr($v['findpattern'], 0, 1) != '\/' || substr($v['findpattern'], -3) != '\/is') {\r\n $v['findpattern'] = '\/'.preg_quote($v['findpattern'], '\/').\r\n '\/is';\r\n }\r\n \/\/end \u4fee\u6539\u7ed3\u675f\r\n $data['findpattern'][$k] = $v['findpattern'];\r\n $data['replace'][$k] = $v['replacement'];\r\n }\r\n}\r\n<\/pre>\n2.\u7b2c\u4e8c\u5904\u4fee\u6539<\/p>\n
\r\nif (!API_UPDATEAPPS) {\r\n return API_RETURN_FORBIDDEN;\r\n}\r\n\/\/ dz uc-key\u4fee\u6539\u5f00\u59cb\r\n$UC_API = '';\r\nif ($post['UC_API']) {\r\n $UC_API = str_replace(array('\\'', '\"', '\\\\', \"\\0\", \"\\n\", \"\\r\"), '', $post['UC_API']);\r\n unset($post['UC_API']);\r\n}\r\n\/\/ \u4fee\u6539\u7ed3\u675f\r\n$cachefile = DISCUZ_ROOT.\r\n'.\/uc_client\/data\/cache\/apps.php';\r\n<\/pre>\n3.\u7b2c\u4e09\u5904\u4fee\u6539<\/p>\n
\r\n$configfile = substr($configfile, -2) == '?>' ? substr($configfile, 0, -2) : $configfile;\r\n\/\/ uc-key \u4fee\u6539\u5f00\u59cb\r\n$configfile = preg_replace(\"\/define\\('UC_API',\\s*'.*?'\\);\/i\", \"define('UC_API', '\".addslashes($UC_API).\r\n \"');\", $configfile);\r\n\/\/ end \u4fee\u6539\u7ed3\u675f\r\nif ($fp = @fopen(DISCUZ_ROOT.\r\n '.\/config\/config_ucenter.php', 'w')) {\r\n @fwrite($fp, trim($configfile));\r\n @fclose($fp);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u89e3\u51b3\u529e\u6cd5\uff1a\u6253\u5f00\/api\/uc.php\u4fee\u6539\u4ee5\u4e0b3\u90e8\u5206\u5185\u5bb9 1.\u7b2c\u4e00\u5904\u4fee\u6539 $data = array(); if […]<\/p>\n","protected":false},"author":1903,"featured_media":253749,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-253750","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=253750"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253750\/revisions"}],"predecessor-version":[{"id":253751,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253750\/revisions\/253751"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/253749"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=253750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=253750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=253750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}