Annotation of embedaddon/php/ext/standard/tests/strings/strip_tags_variation6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strip_tags() function : usage variations - binary safe checking
3: --INI--
4: short_open_tag = on
5: --FILE--
6: <?php
7: /* Prototype : string strip_tags(string $str [, string $allowable_tags])
8: * Description: Strips HTML and PHP tags from a string
9: * Source code: ext/standard/string.c
10: */
11:
12: /*
13: * testing whether strip_tags() is binary safe or not
14: */
15:
16: echo "*** Testing strip_tags() : usage variations ***\n";
17:
18: //various string inputs
19: $strings = array (
20: "<html> I am html string </html>".chr(0)."<?php I am php string ?>",
21: "<html> I am html string\0 </html><?php I am php string ?>",
22: b"<a>I am html string</a>",
23: "<html>I am html string</html>".decbin(65)."<?php I am php string?>"
24: );
25:
26: //loop through the strings array to check if strip_tags() is binary safe
27: $iterator = 1;
28: foreach($strings as $value)
29: {
30: echo "-- Iteration $iterator --\n";
31: var_dump( strip_tags($value) );
32: $iterator++;
33: }
34:
35: echo "Done";
36: ?>
37: --EXPECTF--
38: *** Testing strip_tags() : usage variations ***
39: -- Iteration 1 --
40: string(18) " I am html string "
41: -- Iteration 2 --
42: string(18) " I am html string "
43: -- Iteration 3 --
44: string(16) "I am html string"
45: -- Iteration 4 --
46: string(23) "I am html string1000001"
47: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>