首頁  >  文章  >  後端開發  >  Thinkphp过滤js失效_PHP教程

Thinkphp过滤js失效_PHP教程

WBOY
WBOY原創
2016-07-13 17:17:27906瀏覽

’htmlspecialchars’,//对get,post数据进行htmlspecialchars过滤,这样也不行。

xxxxxx这样的js代码时,需要手动进行htmlspecialchars过滤。

 

<?<span php
</span><span class</span> AdsModel <span extends</span><span  CommonModel {    
    </span><span //</span><span  自动验证设置</span>
    <span protected</span> <span $_validate</span>     =     <span array</span><span (
 
        );
    </span><span //</span><span  自动填充设置</span>
    <span protected</span> <span $_auto</span>     =     <span array</span><span (
            </span><span array</span>('ad_code','getCode',1,'callback'), <span //</span><span  对name字段在新增的时候回调getName方法</span>
<span         );
 
    </span><span protected</span> <span function</span> getCode(<span $ad_code</span><span ){
        </span><span return</span> <span htmlspecialchars</span>(<span $ad_code</span><span );
    }
}</span>

 

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/626605.htmlTechArticle? AdsModel = = ('ad_code','getCode',1,'callback'), getCode( (...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn