xref: /PHP-7.2/ext/filter/tests/042.phpt (revision 17ccbeec)
1--TEST--
2Combination of strip & sanitize filters
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7$var = 'XYZ< script>alert(/ext/filter+bypass/);< /script>ABC';
8$a = filter_var($var, FILTER_SANITIZE_STRING, array("flags" => FILTER_FLAG_STRIP_LOW));
9echo $a . "\n";
10
11$var = 'XYZ<
12script>alert(/ext/filter+bypass/);<
13/script>ABC';
14$a = filter_var($var, FILTER_SANITIZE_STRING, array("flags" => FILTER_FLAG_STRIP_LOW));
15echo $a . "\n";
16?>
17--EXPECT--
18XYZalert(/ext/filter+bypass/);ABC
19XYZalert(/ext/filter+bypass/);ABC
20