Annotation of embedaddon/php/ext/filter/tests/027.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: filter_var() and FILTER_SANITIZE_ENCODED
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("filter")) die("skip"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED));
! 9: var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED));
! 10: var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
! 11:
! 12: var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
! 13: var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
! 14: var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
! 15:
! 16: var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
! 17: var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
! 18: var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
! 19:
! 20: echo "Done\n";
! 21: ?>
! 22: --EXPECT--
! 23: string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
! 24: string(17) "%3Cdata%26sons%3E"
! 25: string(0) ""
! 26: string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
! 27: string(17) "%3Cdata%26sons%3E"
! 28: string(0) ""
! 29: string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
! 30: string(17) "%3Cdata%26sons%3E"
! 31: string(0) ""
! 32: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>