<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                >[danger]永遠不要相信用戶提交的數據! ## 安全開發指導 1. 參考ThinkPHP官方[安全指導](http://www.hmoore.net/manual/thinkphp5/268461) 2. 過濾用戶輸入的內容,DolphinPHP從1.0.5版本開始提供了html安全過濾方法`htmlpurifier()` 比如:`$html = htmlpurifier(request()->post('content'))` 或者:`$html = request()->post('content', '', 'htmlpurifier')` 也可以加在TP的默認過濾規則,如何設置默認過濾規則請參考ThinkPHP官方文檔 3. 前端過濾可以使用`filterXSS()` ~~~ <script> // apply function filterXSS in the same way var html = filterXSS('<script>alert("xss");</scr' + 'ipt>'); alert(html); </script> ~~~ 更多用法,請參考:[https://github.com/leizongmin/js-xss/blob/master/README.zh.md](https://github.com/leizongmin/js-xss/blob/master/README.zh.md) >[info]以上方法僅作為安全輔助,沒有一勞永逸的方法可以防止所有攻擊。要做好數據檢查,選用合適的過濾方法。 ## 禁止訪問敏感目錄 由于框架將入口文件從public移動到了應用目錄,使一些不該被訪問的目錄也暴露了出來。如果將入口文件移動到public目錄,需要改動的地方比較多,所以不建議這樣做。 為了安全考慮,可以將一些敏感目錄設置為禁止訪問。 【Nginx】 在Nginx配置文件中,加入以下規則 ~~~ location ^~ /data { deny all; } location ^~ /runtime { deny all; } location ^~ /export { deny all; } location ^~ /application { deny all; } location ^~ /plugins { deny all; } location ^~ /thinkphp { deny all; } location ^~ /vendor { deny all; } ~~~ 【Apache】 在框架根目錄的.htaccess文件加入以下規則 ~~~ RewriteRule ^data - [F,L] RewriteRule ^runtime - [F,L] RewriteRule ^export - [F,L] RewriteRule ^application - [F,L] RewriteRule ^plugins - [F,L] RewriteRule ^thinkphp - [F,L] RewriteRule ^vendor - [F,L] ~~~ 完整內容 ~~~ <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] RewriteRule ^data - [F,L] RewriteRule ^runtime - [F,L] RewriteRule ^export - [F,L] RewriteRule ^application - [F,L] RewriteRule ^plugins - [F,L] RewriteRule ^thinkphp - [F,L] RewriteRule ^vendor - [F,L] </IfModule> ~~~ ## 修復1.1.0之前的一處安全隱患 如果您的框架沒有升級到1.1.0以上,請按以下方法修復一處文件上傳隱患,主要是由于超級管理可以上傳php文件,一般超級管理賬號密碼沒有泄露是不會有問題的,但還是建議大家修復這個問題。 打開`application\admin\controller\Attachment.php` 大概217行,將 ![](https://box.kancloud.cn/a8e96c5a18a8cba6423b18357dace9eb_530x76.png) 修改為 ~~~ if (preg_grep("/php/i", $ext_limit)) { $error_msg = '禁止上傳非法文件!'; } if (!preg_grep("/$file_ext/i", $ext_limit)) { $error_msg = '附件類型不正確!'; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看