Skip to content

Commit 81e23f9

Browse files
committed
Update tests for HTML encoding and decoding functions using 'ENT_QUOTES|ENT_SUBSTITUTE'
1 parent fa08743 commit 81e23f9

10 files changed

+22
-22
lines changed

ext/standard/tests/strings/bug53021.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ single quotes variations:
3838
'
3939
'
4040
'
41-
'
41+
'

ext/standard/tests/strings/bug61116.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Function [ <internal:standard> function htmlspecialchars ] {
1010

1111
- Parameters [4] {
1212
Parameter #0 [ <required> string $string ]
13-
Parameter #1 [ <optional> int $flags = ENT_COMPAT ]
13+
Parameter #1 [ <optional> int $flags = ENT_QUOTES | ENT_SUBSTITUTE ]
1414
Parameter #2 [ <optional> ?string $encoding = null ]
1515
Parameter #3 [ <optional> bool $double_encode = true ]
1616
}
@@ -21,7 +21,7 @@ Function [ <internal:standard> function get_html_translation_table ] {
2121

2222
- Parameters [3] {
2323
Parameter #0 [ <optional> int $table = HTML_SPECIALCHARS ]
24-
Parameter #1 [ <optional> int $flags = ENT_COMPAT ]
24+
Parameter #1 [ <optional> int $flags = ENT_QUOTES | ENT_SUBSTITUTE ]
2525
Parameter #2 [ <optional> string $encoding = "UTF-8" ]
2626
}
2727
- Return [ array ]

ext/standard/tests/strings/html_entity_decode3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ echo "\nDone.\n";
218218
&#x0E; NOT DECODED
219219
&#x1F; NOT DECODED
220220
&#x20; DECODED
221-
&#x27; NOT DECODED
221+
&#x27; DECODED
222222
&#x7F; NOT DECODED
223223
&#x80; NOT DECODED
224224
&#x9F; NOT DECODED

ext/standard/tests/strings/htmlentities24.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ string(198) "&sbquo;&dagger;&trade;&Yuml;&euro;&sbquo;&dagger;&bdquo;&euro;&perm
310310
string(42) "&lt;html&gt; This is a test! &lt;/html&gt;"
311311

312312
*** Testing htmlentites() on a quote ***
313-
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"
313+
string(46) "A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;"
314314
string(46) "A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;"
315315
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"
316316
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"

ext/standard/tests/strings/htmlspecialchars.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ string(187) "&lt;br&gt;Testing&lt;p&gt;New file.&lt;/p&gt;&lt;p&gt;&lt;br&gt;Fil
306306
string(46) "&lt;br&gt;Testing&lt;p&gt;New file.&lt;/p&gt; "
307307

308308
*** Testing htmlspecialchars() on a quote...
309-
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"
309+
string(46) "A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;"
310310
string(46) "A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;"
311311
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"
312312
string(36) "A 'quote' is &lt;b&gt;bold&lt;/b&gt;"

ext/standard/tests/strings/htmlspecialchars_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Basic tests
5656
Test 1: abc&lt;&gt;&quot;&amp;
5757
Test 2: &amp;&amp;abc&lt;&gt;&quot;&amp;
5858
Test 3: a&gt;,\&lt;bc&lt;&gt;&quot;&amp;
59-
Test 4: a\'\'&amp;bc&lt;&gt;&quot;&amp;
59+
Test 4: a\&#039;\&#039;&amp;bc&lt;&gt;&quot;&amp;
6060
Test 5: &amp;amp;&amp;lt;
6161
Test 6: abc&lt;&gt;"&amp;
6262
Test 7: &amp;&amp;abc&lt;&gt;"&amp;

ext/standard/tests/strings/htmlspecialchars_decode_basic.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ echo "Done";
2626
?>
2727
--EXPECT--
2828
*** Testing htmlspecialchars_decode() : basic functionality ***
29-
string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
30-
string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
29+
string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
30+
string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
3131
string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
3232
string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
3333
string(102) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. &quot; double quoted string &quot;"

ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ string(0) ""
7373
-- Iteration 2 --
7474
string(0) ""
7575
-- Iteration 3 --
76-
string(103) "<html>Roy&#039;s height > Sam&#039;s height
76+
string(93) "<html>Roy's height > Sam's height
7777
13 < 25
7878
1111 & 0000 = 0000
7979
"This is a double quoted string""
8080
-- Iteration 4 --
81-
string(130) "<html>Roy&#039;s height > Sam &#039;s height
81+
string(120) "<html>Roy's height > Sam 's height
8282
1111 & 0000 = 0000
8383
" heredoc
8484
double quoted string. with different white spaces""
@@ -87,8 +87,8 @@ string(62) "<html>11 < 12. 123 string 4567
8787
"string" 1111 & 0000 = 0000
8888
;"
8989
-- Iteration 6 --
90-
string(153) "<html>< This's a string with quotes:
90+
string(143) "<html>< This's a string with quotes:
9191
"strings in double quote" &
9292
'strings in single quote' "
93-
this\line is &#039;single quoted&#039; /with\slashes </html>"
93+
this\line is 'single quoted' /with\slashes </html>"
9494
Done

ext/standard/tests/strings/htmlspecialchars_decode_variation4.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ echo "Done";
3333
--EXPECT--
3434
*** Testing htmlspecialchars_decode() : usage variations ***
3535
-- Iteration 1 --
36-
string(90) "Roy&#039s height > Sam&#039;s \$height... 1111 &ap; 0000 = 0000... " double quote string ""
36+
string(85) "Roy&#039s height > Sam's \$height... 1111 &ap; 0000 = 0000... " double quote string ""
3737
string(90) "Roy&#039s height > Sam&#039;s \$height... 1111 &ap; 0000 = 0000... " double quote string ""
3838
string(100) "Roy&#039s height > Sam&#039;s \$height... 1111 &ap; 0000 = 0000... &quot; double quote string &quot;"
3939
string(85) "Roy&#039s height > Sam's \$height... 1111 &ap; 0000 = 0000... " double quote string ""
4040
-- Iteration 2 --
41-
string(88) "Roy&#039;s height > Sam&#039;s height... \t\t 13 < 15...\n\r " double quote\f\v string ""
41+
string(78) "Roy's height > Sam's height... \t\t 13 < 15...\n\r " double quote\f\v string ""
4242
string(88) "Roy&#039;s height > Sam&#039;s height... \t\t 13 < 15...\n\r " double quote\f\v string ""
4343
string(98) "Roy&#039;s height > Sam&#039;s height... \t\t 13 < 15...\n\r &quot; double quote\f\v string &quot;"
4444
string(78) "Roy's height > Sam's height... \t\t 13 < 15...\n\r " double quote\f\v string ""
4545
-- Iteration 3 --
46-
string(48) "\nRoy&#039;s height &gt\t; Sam&#039;s\v height\f"
46+
string(38) "\nRoy's height &gt\t; Sam's\v height\f"
4747
string(48) "\nRoy&#039;s height &gt\t; Sam&#039;s\v height\f"
4848
string(48) "\nRoy&#039;s height &gt\t; Sam&#039;s\v height\f"
4949
string(38) "\nRoy's height &gt\t; Sam's\v height\f"
5050
-- Iteration 4 --
51-
string(48) "\r\tRoy&#039;s height &gt\r; Sam\t&#039;s height"
51+
string(38) "\r\tRoy's height &gt\r; Sam\t's height"
5252
string(48) "\r\tRoy&#039;s height &gt\r; Sam\t&#039;s height"
5353
string(48) "\r\tRoy&#039;s height &gt\r; Sam\t&#039;s height"
5454
string(38) "\r\tRoy's height &gt\r; Sam\t's height"

ext/standard/tests/strings/htmlspecialchars_decode_variation5.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ echo "Done";
3232
--EXPECT--
3333
*** Testing htmlspecialchars_decode() : usage variations ***
3434
-- Iteration 1 --
35-
string(89) "Roy&#039s height > Sam&#039;s $height... 1111 &ap; 0000 = 0000... " double quote string ""
35+
string(84) "Roy&#039s height > Sam's $height... 1111 &ap; 0000 = 0000... " double quote string ""
3636
string(89) "Roy&#039s height > Sam&#039;s $height... 1111 &ap; 0000 = 0000... " double quote string ""
3737
string(99) "Roy&#039s height > Sam&#039;s $height... 1111 &ap; 0000 = 0000... &quot; double quote string &quot;"
3838
string(84) "Roy&#039s height > Sam's $height... 1111 &ap; 0000 = 0000... " double quote string ""
3939
-- Iteration 2 --
40-
string(82) "Roy&#039;s height > Sam&#039;s height... 13 < 15...
40+
string(72) "Roy's height > Sam's height... 13 < 15...
4141
" double quote string ""
4242
string(82) "Roy&#039;s height > Sam&#039;s height... 13 < 15...
4343
" double quote string ""
@@ -46,16 +46,16 @@ string(92) "Roy&#039;s height > Sam&#039;s height... 13 < 15...
4646
string(72) "Roy's height > Sam's height... 13 < 15...
4747
" double quote string ""
4848
-- Iteration 3 --
49-
string(44) "
50-
Roy&#039;s height &gt ; Sam&#039;s height"
49+
string(34) "
50+
Roy's height &gt ; Sam's height"
5151
string(44) "
5252
Roy&#039;s height &gt ; Sam&#039;s height "
5353
string(44) "
5454
Roy&#039;s height &gt ; Sam&#039;s height "
5555
string(34) "
5656
Roy's height &gt ; Sam's height "
5757
-- Iteration 4 --
58-
string(44) " Roy&#039;s height &gt; Sam &#039;s height"
58+
string(34) " Roy's height &gt; Sam 's height"
5959
string(44) " Roy&#039;s height &gt; Sam &#039;s height"
6060
string(44) " Roy&#039;s height &gt; Sam &#039;s height"
6161
string(34) " Roy's height &gt; Sam 's height"

0 commit comments

Comments
 (0)