From: Arnaud Le Blanc Date: Fri, 24 Apr 2009 21:23:47 +0000 (+0000) Subject: strip_tags() fixes: X-Git-Tag: php-5.4.0alpha1~191^2~3863 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c400890edf15fb5ac1302f1e7171031c5a4fe4b;p=php strip_tags() fixes: - MFH5.3 (Fix bug when < is used within attribute.) - Fix handling of case when searching for allowed tags in unicode variant - tests for both unicode and binary variants --- diff --git a/ext/standard/string.c b/ext/standard/string.c index ec500fc74d..fe3cd237b0 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6253,7 +6253,8 @@ int php_u_tag_find(UChar *tag, int len, UChar *set, int set_len) while (!done) { U16_NEXT(tag, idx, len, ch); - switch (u_tolower(ch)) { + ch = u_tolower(ch); + switch (ch) { case '<': *(n++) = ch; break; @@ -6403,6 +6404,9 @@ PHPAPI int php_u_strip_tags(UChar *rbuf, int len, int *stateptr, UChar *allow, i break; case 0x3C: /* '<' */ + if (in_q) { + break; + } U16_GET(buf, 0, idx, len, next); if (u_isWhitespace(next) == TRUE) { goto reg_u_char; diff --git a/ext/standard/tests/strings/bug21453_binary.phpt b/ext/standard/tests/strings/bug21453_binary.phpt new file mode 100644 index 0000000000..3d060c26e6 --- /dev/null +++ b/ext/standard/tests/strings/bug21453_binary.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #21453 (handling of non-encoded <), binary variant +--FILE-- + + first cell before < first cell after + second cell before < second cell after +"; + + var_dump(strip_tags($test)); +?> +--EXPECT-- +string(80) " + + first cell before < first cell after + second cell before < second cell after +" diff --git a/ext/standard/tests/strings/bug21744_binary.phpt b/ext/standard/tests/strings/bug21744_binary.phpt new file mode 100644 index 0000000000..5ce5c5af3c --- /dev/null +++ b/ext/standard/tests/strings/bug21744_binary.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #21744 (strip_tags misses exclamation marks in alt text), binary variant +--FILE-- +test + +HERE; + +print strip_tags($test, ''); +print strip_tags($test, ''); +?> +--EXPECT-- +test +test diff --git a/ext/standard/tests/strings/bug22008_binary.phpt b/ext/standard/tests/strings/bug22008_binary.phpt new file mode 100644 index 0000000000..4deefcc5c5 --- /dev/null +++ b/ext/standard/tests/strings/bug22008_binary.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #22008 (strip_tags() eliminates too much), binary variant +--FILE-- + + + +test + + +PHP! + + + +HERE; + +echo trim(strip_tags($html, ''))."\n"; +?> +--EXPECT-- +test + + +PHP! diff --git a/ext/standard/tests/strings/bug23650_binary.phpt b/ext/standard/tests/strings/bug23650_binary.phpt new file mode 100644 index 0000000000..dad98f19d4 --- /dev/null +++ b/ext/standard/tests/strings/bug23650_binary.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #23650 (strip_tags() removes hyphens), binary variant +--FILE-- + +2: +3: +4: +5:abc - def +6: + +HERE; + +echo strip_tags($str); +echo strip_tags($str, b''); +?> +--EXPECT-- +1: +2: +3: +4: +5:abc - def +6: +1: +2: +3: +4: +5:abc - def +6: diff --git a/ext/standard/tests/strings/bug40432_binary.phpt b/ext/standard/tests/strings/bug40432_binary.phpt new file mode 100644 index 0000000000..e4076ea015 --- /dev/null +++ b/ext/standard/tests/strings/bug40432_binary.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #40432 (strip_tags() fails with greater than in attribute), binary variant +--FILE-- + all">this') . "\n"; +?> +--EXPECT-- +this diff --git a/ext/standard/tests/strings/bug40637_binary.phpt b/ext/standard/tests/strings/bug40637_binary.phpt new file mode 100644 index 0000000000..78ba0849cc --- /dev/null +++ b/ext/standard/tests/strings/bug40637_binary.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #40637 (strip_tags() does not handle single quotes correctly), binary variant +--FILE-- +Text'; +var_dump(strip_tags($html)); + +echo "Done\n"; +?> +--EXPECT-- +unicode(4) "Text" +Done diff --git a/ext/standard/tests/strings/bug40704_binary.phpt b/ext/standard/tests/strings/bug40704_binary.phpt new file mode 100644 index 0000000000..6cb8d3a21a --- /dev/null +++ b/ext/standard/tests/strings/bug40704_binary.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #40704 (strip_tags() does not handle single quotes correctly), binary variant +--FILE-- +Bug ' Trigger Missing Text"; +var_dump(strip_tags($html)); + +echo "Done\n"; +?> +--EXPECT-- +string(26) "Bug ' Trigger Missing Text" +Done diff --git a/ext/standard/tests/strings/bug45485_binary.phpt b/ext/standard/tests/strings/bug45485_binary.phpt new file mode 100644 index 0000000000..15e60c1dbe --- /dev/null +++ b/ext/standard/tests/strings/bug45485_binary.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #45485 (strip_tags and This Text disappears +EOD; + +$s = strip_tags($s); +echo htmlspecialchars($s),"\n"; + +$s = (binary) <<< EOD +This text is shown This Text disappears +EOD; + +$s = strip_tags($s); +echo htmlspecialchars($s),"\n"; + +?> +--EXPECT-- +This text is shown This Text disappears +This text is shown This Text disappears diff --git a/ext/standard/tests/strings/bug46578_binary.phpt b/ext/standard/tests/strings/bug46578_binary.phpt new file mode 100644 index 0000000000..4cbbe4a67b --- /dev/null +++ b/ext/standard/tests/strings/bug46578_binary.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #46578 (strip_tags() does not honor end-of-comment when it encounters a single quote), binary variant +--FILE-- +foobar')); + +var_dump(strip_tags(b'foobar')); + +var_dump(strip_tags(b'foo */ ?>bar')); + +var_dump(strip_tags(b'< ax')); + +var_dump(strip_tags(b'')); + +var_dump(strip_tags(b' +--EXPECTF-- +string(6) "foobar" +string(6) "foobar" +string(6) "foobar" +string(4) "< ax" +string(0) "" +string(0) "" diff --git a/ext/standard/tests/strings/strip_tags_basic1_binary.phpt b/ext/standard/tests/strings/strip_tags_basic1_binary.phpt new file mode 100644 index 0000000000..97c850e31f --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_basic1_binary.phpt @@ -0,0 +1,75 @@ +--TEST-- +Test strip_tags() function : basic functionality - with default arguments, binary variant +--INI-- +short_open_tag = on +--FILE-- +hello", + b'hello', + b"", + b'', + b"", + b'', + b"<% echo hello %>", + b'<% echo hello %>', + b"", + b'', + b"hello

world

", + b'hello

world

', + b"", + b'' +); + + +// Calling strip_tags() with default arguments +// loop through the $string_array to test strip_tags on various inputs +$iteration = 1; +foreach($string_array as $string) +{ + echo "-- Iteration $iteration --\n"; + var_dump( strip_tags($string) ); + $iteration++; +} + +echo "Done"; +?> +--EXPECT-- +*** Testing strip_tags() : basic functionality *** +-- Iteration 1 -- +string(5) "hello" +-- Iteration 2 -- +string(5) "hello" +-- Iteration 3 -- +string(0) "" +-- Iteration 4 -- +string(0) "" +-- Iteration 5 -- +string(0) "" +-- Iteration 6 -- +string(0) "" +-- Iteration 7 -- +string(0) "" +-- Iteration 8 -- +string(0) "" +-- Iteration 9 -- +string(12) " echo hello " +-- Iteration 10 -- +string(12) " echo hello " +-- Iteration 11 -- +string(10) "helloworld" +-- Iteration 12 -- +string(10) "helloworld" +-- Iteration 13 -- +string(0) "" +-- Iteration 14 -- +string(0) "" +Done diff --git a/ext/standard/tests/strings/strip_tags_basic2_binary.phpt b/ext/standard/tests/strings/strip_tags_basic2_binary.phpt new file mode 100644 index 0000000000..27aa211664 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_basic2_binary.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test strip_tags() function : basic functionality - with all arguments, binary variant +--INI-- +short_open_tag = on +--FILE-- +

hello

world
Other text"; + +$allowed_tags_array=array( + b"", + b'', + b"

", + b'

', + b"", + b'', + b"

+--EXPECT-- +*** Testing strip_tags() : basic functionality *** +-- Iteration 1 -- +string(33) "helloworldOther text" +-- Iteration 2 -- +string(33) "helloworldOther text" +-- Iteration 3 -- +string(27) "

hello

worldOther text" +-- Iteration 4 -- +string(27) "

hello

worldOther text" +-- Iteration 5 -- +string(44) "helloworld
Other text" +-- Iteration 6 -- +string(44) "helloworldOther text" +-- Iteration 7 -- +string(20) "helloworldOther text" +-- Iteration 8 -- +string(20) "helloworldOther text" +-- Iteration 9 -- +string(64) "

hello

worldOther text" +Done diff --git a/ext/standard/tests/strings/strip_tags_binary.phpt b/ext/standard/tests/strings/strip_tags_binary.phpt new file mode 100644 index 0000000000..f307ec1f2c --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_binary.phpt @@ -0,0 +1,27 @@ +--TEST-- +strip_tags() function, binary variant +--FILE-- + STUFF'); + echo "\n"; + echo strip_tags(b'NEAT blah ?> STUFF'); + echo "\n"; + echo strip_tags(b'NEAT STUFF'); + echo "\n"; + echo strip_tags(b'NEAT STUFF'); + echo "\n"; + echo strip_tags(b'NEAT STUFF'); + echo "\n"; + echo strip_tags(b'NEAT STUFF'); + echo "\n"; + echo strip_tags(b'TESTS ?!!?!?!!!?!!'); + echo "\n"; +?> +--EXPECT-- +NEAT STUFF +NEAT STUFF +NEAT STUFF +NEAT STUFF +NEAT STUFF +NEAT STUFF +TESTS ?!!?!?!!!?!! diff --git a/ext/standard/tests/strings/strip_tags_error_binary.phpt b/ext/standard/tests/strings/strip_tags_error_binary.phpt new file mode 100644 index 0000000000..47dcba2923 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_error_binary.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test strip_tags() function : error conditions, binary variant +--INI-- +short_open_tag = on +--FILE-- +hello"; +$allowable_tags = b""; +$extra_arg = 10; +var_dump( strip_tags($str, $allowable_tags, $extra_arg) ); + +echo "Done"; +?> +--EXPECTF-- +*** Testing strip_tags() : error conditions *** + +-- Testing strip_tags() function with Zero arguments -- + +Warning: strip_tags() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing strip_tags() function with more than expected no. of arguments -- + +Warning: strip_tags() expects at most 2 parameters, 3 given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/strings/strip_tags_variation10_binary.phpt b/ext/standard/tests/strings/strip_tags_variation10_binary.phpt new file mode 100644 index 0000000000..7cc014eddc --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation10_binary.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test strip_tags() function : usage variations - single quoted strings, binary variant +--INI-- +short_open_tag = on +--FILE-- + \$ -> This represents the dollar sign', + b'\t\r\v The quick brown fo\fx jumped over the lazy dog

', + b'This is a hyper text tag', + b'hello world\\t?>', + b'

This is a paragraph

', + b'This is \ta text in bold letters\r\s\malong with slashes\n' +); + +$quotes = b"

+--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(51) " \$ -> This represents the dollar sign" +-- Iteration 2 -- +string(63) "\t\r\v The quick brown fo\fx jumped over the lazy dog

" +-- Iteration 3 -- +string(31) "
This is a hyper text tag" +-- Iteration 4 -- +string(0) "" +-- Iteration 5 -- +string(26) "

This is a paragraph

" +-- Iteration 6 -- +string(65) "This is \ta text in bold letters\r\s\malong with slashes\n" +Done diff --git a/ext/standard/tests/strings/strip_tags_variation11_binary.phpt b/ext/standard/tests/strings/strip_tags_variation11_binary.phpt new file mode 100644 index 0000000000..f39657a680 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation11_binary.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test strip_tags() function : obscure values within attributes, binary variant +--INI-- +short_open_tag = on +--FILE-- + world', + b'hello world', + b'hello world', + b"hello world" +); + + +// Calling strip_tags() with default arguments +// loop through the $string_array to test strip_tags on various inputs +$iteration = 1; +foreach($string_array as $string) +{ + echo "-- Iteration $iteration --\n"; + var_dump( strip_tags($string) ); + $iteration++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing strip_tags() : obscure functionality *** +-- Iteration 1 -- +string(12) "hello world" +-- Iteration 2 -- +string(12) "hello world" +-- Iteration 3 -- +string(12) "hello world" +-- Iteration 4 -- +string(12) "hello world" +Done diff --git a/ext/standard/tests/strings/strip_tags_variation4.phpt b/ext/standard/tests/strings/strip_tags_variation4.phpt index a77d231dc1..10066738ce 100644 --- a/ext/standard/tests/strings/strip_tags_variation4.phpt +++ b/ext/standard/tests/strings/strip_tags_variation4.phpt @@ -56,9 +56,9 @@ unicode(0) "" -- Iteration 4 -- unicode(0) "" -- Iteration 5 -- -unicode(5) "hello" +unicode(18) "hello" -- Iteration 6 -- -unicode(5) "hello" +unicode(18) "hello" -- Iteration 7 -- unicode(9) "HtMl text" -- Iteration 8 -- diff --git a/ext/standard/tests/strings/strip_tags_variation4_binary.phpt b/ext/standard/tests/strings/strip_tags_variation4_binary.phpt new file mode 100644 index 0000000000..6d290bc6ac --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation4_binary.phpt @@ -0,0 +1,74 @@ +--TEST-- +Test strip_tags() function : usage variations - invalid values for 'str' and valid 'allowable_tags', binary variant +--INI-- +short_open_tag = on +--FILE-- +hello
\t\tworld... strip_tags_test", + b'hello \t\tworld... strip_tags_test', + b"<%?php hello\t world?%>", + b'<%?php hello\t world?%>', + b"<>hello<>", + b'<>hello<>', + b"HtMl text", + b'HtMl text', + b"I am not a valid html text", + b'I am not a valid html text', + b"I am a quoted (\") string with special chars like \$,\!,\@,\%,\&", + b'I am a quoted (\") string with special chars like \$,\!,\@,\%,\&', +); + +//valid html and php tags +$quotes = b"

"; + +//loop through the various elements of strings array to test strip_tags() functionality +$iterator = 1; +foreach($strings as $string_value) +{ + echo "-- Iteration $iterator --\n"; + var_dump( strip_tags($string_value, $quotes) ); + $iterator++; +} + +echo "Done"; +?> +--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(32) "hello world... strip_tags_test" +-- Iteration 2 -- +string(34) "hello \t\tworld... strip_tags_test" +-- Iteration 3 -- +string(0) "" +-- Iteration 4 -- +string(0) "" +-- Iteration 5 -- +string(18) "hello" +-- Iteration 6 -- +string(18) "hello" +-- Iteration 7 -- +string(9) "HtMl text" +-- Iteration 8 -- +string(9) "HtMl text" +-- Iteration 9 -- +string(26) "I am not a valid html text" +-- Iteration 10 -- +string(26) "I am not a valid html text" +-- Iteration 11 -- +string(62) "I am a quoted (") string with special chars like $,\!,\@,\%,\&" +-- Iteration 12 -- +string(64) "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&" +Done diff --git a/ext/standard/tests/strings/strip_tags_variation5_binary.phpt b/ext/standard/tests/strings/strip_tags_variation5_binary.phpt new file mode 100644 index 0000000000..e7d3ffd964 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation5_binary.phpt @@ -0,0 +1,105 @@ +--TEST-- +Test strip_tags() function : usage variations - heredoc strings, binary variant +--INI-- +set short_open_tag = on +--FILE-- +hello world +

13 < 25

+ +This is a double quoted string +EOT; + +// here doc with diferent whitespaces +$diff_whitespaces = <<hello\r world\t +1111\t\t != 2222\v\v + +EOT; + +// here doc with numeric values +$numeric_string = <<11 < 12. 123 >22 +

string

1111\t 0000\t = 0000\n +EOT; + +// heredoc with quote chars & slash +$quote_char_string = <<This's a string with quotes: +"strings in double quote"; +'strings in single quote'; +this\line is single quoted /with\slashes +EOT; + +$res_heredoc_strings = array( + //heredoc strings + $null_string, + $blank_line, + $multiline_string, + $diff_whitespaces, + $numeric_string, + $quote_char_string +); + +// initialize the second argument +$quotes = "
+--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(0) "" +-- Iteration 2 -- +string(0) "" +-- Iteration 3 -- +string(67) "hello world +13 < 25 + +This is a double quoted string" +-- Iteration 4 -- +string(44) "hello + world +1111 != 2222 +" +-- Iteration 5 -- +string(56) "11 < 12. 123 >22 +string 1111 0000 = 0000 +" +-- Iteration 6 -- +string(150) "This's a string with quotes: +"strings in double quote"; +'strings in single quote'; +this\line is single quoted /with\slashes " +Done diff --git a/ext/standard/tests/strings/strip_tags_variation6_binary.phpt b/ext/standard/tests/strings/strip_tags_variation6_binary.phpt new file mode 100644 index 0000000000..1cdd1ab206 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation6_binary.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test strip_tags() function : usage variations - binary safe checking, binary variant +--INI-- +short_open_tag = on +--FILE-- + I am html string ".chr(0)."", + " I am html string\0 ", + b"I am html string", + "I am html string".decbin(65)."" +); + +//loop through the strings array to check if strip_tags() is binary safe +$iterator = 1; +foreach($strings as $value) +{ + echo "-- Iteration $iterator --\n"; + var_dump( strip_tags((binary)$value) ); + $iterator++; +} + +echo "Done"; +?> +--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(18) " I am html string " +-- Iteration 2 -- +string(18) " I am html string " +-- Iteration 3 -- +string(16) "I am html string" +-- Iteration 4 -- +string(23) "I am html string1000001" +Done diff --git a/ext/standard/tests/strings/strip_tags_variation7.phpt b/ext/standard/tests/strings/strip_tags_variation7.phpt index a0c2a2400f..c7f94491da 100644 --- a/ext/standard/tests/strings/strip_tags_variation7.phpt +++ b/ext/standard/tests/strings/strip_tags_variation7.phpt @@ -54,9 +54,9 @@ unicode(0) "" -- Iteration 4 -- unicode(0) "" -- Iteration 5 -- -unicode(5) "hello" +unicode(18) "hello" -- Iteration 6 -- -unicode(5) "hello" +unicode(18) "hello" -- Iteration 7 -- unicode(9) "HtMl text" -- Iteration 8 -- diff --git a/ext/standard/tests/strings/strip_tags_variation7_binary.phpt b/ext/standard/tests/strings/strip_tags_variation7_binary.phpt new file mode 100644 index 0000000000..bb87f2d146 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation7_binary.phpt @@ -0,0 +1,72 @@ +--TEST-- +Test strip_tags() function : usage variations - invalid values for 'str' and 'allowable_tags', binary variant +--INI-- +short_open_tag = on +--FILE-- +hello \t\tworld... strip_tags_test", + b'hello \t\tworld... strip_tags_test', + b"<%?php hello\t world?%>", + b'<%?php hello\t world?%>', + b"<>hello<>", + b'<>hello<>', + b"HtMl text", + b'HtMl text', + b"I am not a valid html text", + b'I am not a valid html text', + b"I am a quoted (\") string with special chars like \$,\!,\@,\%,\&", + b'I am a quoted (\") string with special chars like \$,\!,\@,\%,\&', +); + +$quotes = b"<%?<>"; + +//loop through the various elements of strings array to test strip_tags() functionality +$iterator = 1; +foreach($strings as $string_value) +{ + echo "-- Iteration $iterator --\n"; + var_dump( strip_tags($string_value, $quotes) ); + $iterator++; +} + +echo "Done"; +?> +--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(43) "hello world... strip_tags_test" +-- Iteration 2 -- +string(45) "hello \t\tworld... strip_tags_test" +-- Iteration 3 -- +string(0) "" +-- Iteration 4 -- +string(0) "" +-- Iteration 5 -- +string(18) "hello" +-- Iteration 6 -- +string(18) "hello" +-- Iteration 7 -- +string(9) "HtMl text" +-- Iteration 8 -- +string(9) "HtMl text" +-- Iteration 9 -- +string(37) "I am not a valid html text" +-- Iteration 10 -- +string(37) "I am not a valid html text" +-- Iteration 11 -- +string(73) "I am a quoted (") string with special chars like $,\!,\@,\%,\&" +-- Iteration 12 -- +string(75) "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&" +Done diff --git a/ext/standard/tests/strings/strip_tags_variation8_binary.phpt b/ext/standard/tests/strings/strip_tags_variation8_binary.phpt new file mode 100644 index 0000000000..dbb582db8b --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation8_binary.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test strip_tags() function : usage variations - valid value for 'str' and invalid values for 'allowable_tags', binary variant +--INI-- +short_open_tag = on +--FILE-- +hello \tworld...

strip_tags_test\v\f

"; + +$quotes = array ( + b"", + b'', + b"", + b'', + b"<%?php", + b'<%?php', + b"<>", + b'<>' +); + +//loop through the various elements of strings array to test strip_tags() functionality +$iterator = 1; +foreach($quotes as $string_value) +{ + echo "-- Iteration $iterator --\n"; + var_dump( strip_tags($strings, $string_value) ); + $iterator++; +} + +echo "Done"; +--EXPECT-- +*** Testing strip_tags() : usage variations *** +-- Iteration 1 -- +string(33) "hello world... strip_tags_test " +-- Iteration 2 -- +string(33) "hello world... strip_tags_test " +-- Iteration 3 -- +string(33) "hello world... strip_tags_test " +-- Iteration 4 -- +string(33) "hello world... strip_tags_test " +-- Iteration 5 -- +string(33) "hello world... strip_tags_test " +-- Iteration 6 -- +string(33) "hello world... strip_tags_test " +-- Iteration 7 -- +string(46) "hello world... strip_tags_test " +-- Iteration 8 -- +string(46) "hello world... strip_tags_test " +Done diff --git a/ext/standard/tests/strings/strip_tags_variation9_binary.phpt b/ext/standard/tests/strings/strip_tags_variation9_binary.phpt new file mode 100644 index 0000000000..0e678a5485 --- /dev/null +++ b/ext/standard/tests/strings/strip_tags_variation9_binary.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test strip_tags() function : usage variations - double quoted strings, binary variant +--INI-- +set short_open_tag = on +--FILE-- + \$ -> This represents the dollar sign", + b"\t\r\v The quick brown fo\fx jumped over the lazy dog

", + b"This is a hyper text tag", + b"hello world\\t?>", + b"

This is a paragraph

", + b"This is \ta text in bold letters\r\s\malong with slashes\n" +); + +$quotes = b"

$ -> This represents the dollar sign" +-- Iteration 2 -- +string(59) " + The quick brown fo x jumped over the lazy dog

" +-- Iteration 3 -- +string(31) "
This is a hyper text tag" +-- Iteration 4 -- +string(0) "" +-- Iteration 5 -- +string(26) "

This is a paragraph

" +-- Iteration 6 -- +string(62) "This is a text in bold letters +\s\malong with slashes +" +Done