注册送现金一元秒提现

    <dir id='feiiz'><del id='feiiz'><del id='feiiz'></del><pre id='feiiz'><pre id='feiiz'><option id='feiiz'><address id='feiiz'></address><bdo id='feiiz'><tr id='feiiz'><acronym id='feiiz'><pre id='feiiz'></pre></acronym><div id='feiiz'></div></tr></bdo></option></pre><small id='feiiz'><address id='feiiz'><u id='feiiz'><legend id='feiiz'><option id='feiiz'><abbr id='feiiz'></abbr><li id='feiiz'><pre id='feiiz'></pre></li></option></legend><select id='feiiz'></select></u></address></small></pre></del><sup id='feiiz'></sup><blockquote id='feiiz'><dt id='feiiz'></dt></blockquote><blockquote id='feiiz'></blockquote></dir><tt id='feiiz'></tt><u id='feiiz'><tt id='feiiz'><form id='feiiz'></form></tt><td id='feiiz'><dt id='feiiz'></dt></td></u>
  1. <code id='feiiz'><i id='feiiz'><q id='feiiz'><legend id='feiiz'><pre id='feiiz'><style id='feiiz'><acronym id='feiiz'><i id='feiiz'><form id='feiiz'><option id='feiiz'><center id='feiiz'></center></option></form></i></acronym></style><tt id='feiiz'></tt></pre></legend></q></i></code><center id='feiiz'></center>

      <dd id='feiiz'></dd>

        <style id='feiiz'></style><sub id='feiiz'><dfn id='feiiz'><abbr id='feiiz'><big id='feiiz'><bdo id='feiiz'></bdo></big></abbr></dfn></sub>
        <dir id='feiiz'></dir>

        1. <form id='xif3t'></form>
            <bdo id='xif3t'><sup id='xif3t'><div id='xif3t'><bdo id='xif3t'></bdo></div></sup></bdo>

                1. <form id='b5kqt'></form>
                    <bdo id='b5kqt'><sup id='b5kqt'><div id='b5kqt'><bdo id='b5kqt'></bdo></div></sup></bdo>

                      • 当前位置:首页 > CMS教程 > 其它CMS > 列表

                        如何在laravel 5中创建用于XSS防御的中间件?

                        发布:smiling 来源: PHP粉丝网  添加日期:2019-01-16 10:43:07 浏览: 评论:0 

                        XSS(KUAZHANDIANJIAOBEN)FANGYUKEYISHUOSHIZAIZHANDIANZHONGBIXUSHIYONGDE,RUGUOBUSHIYONGXSSFANGYU,NEIMENIDEZHANDIANJIUJIQIBUANQUAN。XSSGUOLVQIKEYICONGSHURUZHIZHONGSHANCHUhtmlBIAOJI,SUOYIWEILEANQUANQIJIAN,SHANCHUhtmlBIAOJIFEICHANGZHONGYAO。ZAIlaravel 5.2ZHONG,KEYITONGGUOZAIXIANGMUZHONGSHIYONGZHONGJIANJIANGAINIANLAISHIXIAN。

                        XIAMIANWOJIUJIDAJIAJIESHAORUHEZAIlaravelYINGYONGCHENGXUZHONGCHUANGJIANXSSGUOLVZHONGJIANJIAN。

                        注册送现金一元秒提现SHOUXIANQIDONGYIXIAMINGLINGBINGCHUANGJIANZHONGJIANJIAN:

                        CHUANGJIANZHONGJIANJIAN:

                        php artisan make:middleware XSS

                        XIANZAI,NIKEYIZAIapp/Http/Middleware/XSS.phpZHONGKANDAOXINWENJIAN,BINGJIANGXIAMIANDEDAIMAFANGRUNIDEXSS.phpWENJIANZHONG。

                        XSS.php

                        1. namespace App\Http\Middleware; 
                        2.  
                        3. use Closure; 
                        4.  
                        5. use Illuminate\Http\Request; 
                        6.  
                        7. class XSS 
                        8.  
                        9.  
                        10.     public function handle(Request $request, Closure $next
                        11.  
                        12.     { 
                        13.  
                        14.         $input = $request->all(); 
                        15.  
                        16.         array_walk_recursive($inputfunction(&$input) { 
                        17.  
                        18.             $input = strip_tags($input); 
                        19. //mailanhe.com 
                        20.         }); 
                        21.  
                        22.         $request->merge($input); 
                        23.  
                        24.         return $next($request); 
                        25.  
                        26.     } 
                        27.  

                        ZUIHOU,BIXUZAIapp/Http/Kernel.phpWENJIANZHONGZHUCEZHONGJIANJIAN。BINGZAI$routeMiddlewareSHUZUZHONGTIANJIAYIXIAXING。

                        Kernel.php

                        1. class Kernel extends HttpKernel 
                        2.  
                        3.  
                        4.     .... 
                        5.  
                        6.     protected $routeMiddleware = [ 
                        7.  
                        8.         'auth' => \App\Http\Middleware\Authenticate::class
                        9.  
                        10.         .... 
                        11.  
                        12.         'XSS' => \App\Http\Middleware\XSS::class
                        13.  
                        14.     ]; 
                        15.  

                        XIANZAINIKEYIZAINIDErouting .phpWENJIANZHONGSHIYONGXSSZHONGJIANJIANLE,ZAIXIAMIANrouting .phpWENJIANZHONGNIKEYIZHEIYANGZUO:

                        routes.php

                        1. Route::group(['middleware' => ['XSS']], function () { 
                        2.  
                        3.   Route::get('customVali''CustomValDemoController@customVali'); 
                        4.  
                        5.   Route::post('customValiPost''CustomValDemoController@customValiPost'); 
                        6.  
                        7. }); 

                        Tags: laravel

                        分享到:

                        靠谱的棋牌---首页_Welcome 蓝洞棋牌官网送3金币---首页_Welcome 百灵拼三张-Welcome 聚友棋牌官网下载安装-首页 百胜棋牌---首页_欢迎您