Asf_Util::filterXss

Xss security filter, Filter the 0x01,0x02,0x03,0x04,0x05

Support for Array, String


Description

public static mixed Asf_Util::filterXss(mixed $data)

Parameters

data

Input a mixed

Return Values

Return the is filtered security data

Examples

Example #1 Filter the String data

<?php var_dump(Asf_Util::filterXss("<input type='text' value='<>'>")); var_dump(Asf_Util::filterXss('<img src="x" onerror="&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;">')); var_dump(Asf_Util::filterXss('<a href="javasc&NewLine;ript&colon;alert(1)">click</a>')); var_dump(Asf_Util::filterXss('<a href="data:text/html;base64, PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPg==">test</a>'));

The above example will output:

string(62) "<input type='text' value='<>'>"
string(126) "<img src="x" onerror="&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;">"
string(84) "<a href="javasc&NewLine;ript&colon;alert(1)">click</a>"
string(104) "<a href="data:text/html;base64, PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPg==">test</a>"

Example #2 Filter the Array data

<?php $data = ['<script>', ';!@#!@$@!']; var_dump(Asf\Util::filterXss($data));