{"id":1283,"date":"2014-12-17T17:15:56","date_gmt":"2014-12-17T09:15:56","guid":{"rendered":"https:\/\/cowmanchiang.me\/wp\/?p=1283"},"modified":"2023-10-31T15:44:25","modified_gmt":"2023-10-31T07:44:25","slug":"xibo-%e4%bf%ae%e6%ad%a3%e4%b8%8a%e5%82%b3%e4%b8%ad%e6%96%87%e6%aa%94%e6%98%8e%e6%9c%83%e7%a9%ba%e7%99%bd","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=1283","title":{"rendered":"Xibo \u4fee\u6b63\u4e0a\u50b3\u4e2d\u6587\u6a94\u540d\u6703\u7a7a\u767d"},"content":{"rendered":"<p>\u4fee\u6539 {xibo}\/3rdparty\/jquery-file-upload\/UploadHandler.php<\/p>\n<p>\u4e3b\u8981\u662f\u56e0\u70babasename\u9019\u500bfunction\u5c0d\u89e3\u6790\u4e2d\u6587\u6703\u6709\u554f\u984c~<\/p>\n<pre lang=\"php\">\n protected function trim_file_name($name, $type, $index, $content_range) {\n        \/\/ Remove path information and dots around the filename, to prevent uploading\n        \/\/ into different directories or replacing hidden system files.\n        \/\/ Also remove control characters and spaces (x00..x20) around the filename:\n\n        \/\/\u539f\u672c\u662f\n        \/\/$name = trim(basename(stripslashes($name)), \".x00..x20\");\n        \/\/\u4fee\u6539\u70ba\n        $name = preg_replace('\/^.+[\\\\\\\/]\/', '', $name);\n\n        \/\/ Use a timestamp for empty filenames:\n        if (!$name) {\n            $name = str_replace('.', '-', microtime(true));\n        }\n        \/\/ Add missing file extension for known image types:\n        if (strpos($name, '.') === false &&\n            preg_match('\/^image\/(gif|jpe?g|png)\/', $type, $matches)) {\n            $name .= '.'.$matches[1];\n        }\n        return $name;\n    }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4fee\u6539 {xibo}\/3rdparty\/jquery-file-upload\/UploadHandler.php \u4e3b\u8981\u662f\u56e0\u70babasename\u9019\u500bfunction\u5c0d\u89e3\u6790\u4e2d\u6587\u6703\u6709\u554f\u984c~ protected function trim_file_name($name, $type, $index, $content_range) { \/\/ Remove path information and dots around the filename, to prevent uploading \/\/ into different directories or replacing hidden system files. \/\/ Also remove control characters and spaces (x00..x20) around &hellip; <a href=\"https:\/\/cowmanchiang.me\/wp\/?p=1283\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[],"class_list":["post-1283","post","type-post","status-publish","format-standard","hentry","category-xibo"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1283"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1283\/revisions"}],"predecessor-version":[{"id":1964,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1283\/revisions\/1964"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}