com php-src: Add additional test coverage for html_entity_d ecode: ext/standard/tests/strings/bug53021.phpt
ext/standard/tests/strings/html_entity_decode3.phpt

From: Date: Wed, 10 Feb 2016 22:52:49 +0000
Subject: com php-src: Add additional test coverage for html_entity_d ecode: ext/standard/tests/strings/bug53021.phpt
ext/standard/tests/strings/html_entity_decode3.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91039@lists.php.net to get a copy of this message
Commit: f61429fabf67be15310ed7b8bce29053079d2668 Author: Matthew Flaschen <matthew@matthew-zenbook> Wed, 10 Feb 2016 17:52:49 -0500 Parents: 85ce6a7d38e2f8570dc4cfcf80f7e0b1683fdd33 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f61429fabf67be15310ed7b8bce29053079d2668 Log: Add additional test coverage for html_entity_decode Will help testing a HHVM fix (https://reviews..facebook.net/D53871) Changed paths: M ext/standard/tests/strings/bug53021.phpt M ext/standard/tests/strings/html_entity_decode3.phpt Diff: diff --git a/ext/standard/tests/strings/bug53021.phpt b/ext/standard/tests/strings/bug53021.phpt index 4a8fbe4..38d9047 100644 --- a/ext/standard/tests/strings/bug53021.phpt +++ b/ext/standard/tests/strings/bug53021.phpt @@ -10,11 +10,14 @@ echo html_entity_decode("&quot;", ENT_QUOTES, 'UTF-8'), "\n"; echo html_entity_decode("&#34;", ENT_QUOTES, 'UTF-8'), "\n"; echo html_entity_decode("&quot;", ENT_COMPAT, 'UTF-8'), "\n"; echo html_entity_decode("&#34;", ENT_COMPAT, 'UTF-8'), "\n"; +echo html_entity_decode("&quot;"), "\n"; +echo html_entity_decode("&#34;"), "\n"; echo "\nsingle quotes variations:", "\n"; echo html_entity_decode("&#39;", ENT_NOQUOTES, 'UTF-8'), "\n"; echo html_entity_decode("&#39;", ENT_QUOTES, 'UTF-8'), "\n"; echo html_entity_decode("&#39;", ENT_COMPAT, 'UTF-8'), "\n"; +echo html_entity_decode("&#39;"), "\n"; --EXPECT-- array(1) { [1]=> @@ -27,8 +30,11 @@ double quotes variations: " " " +" +" single quotes variations: &#39; ' &#39; +&#39; diff --git a/ext/standard/tests/strings/html_entity_decode3.phpt b/ext/standard/tests/strings/html_entity_decode3.phpt index fcf2710..48cff17 100644 --- a/ext/standard/tests/strings/html_entity_decode3.phpt +++ b/ext/standard/tests/strings/html_entity_decode3.phpt @@ -14,6 +14,7 @@ $tests = array( "&#x0E;", "&#x1F;", "&#x20;", //allowed always + "&#x27;", //single quote, depends on flags "&#x7F;", //DEL "&#x80;", //C1 "&#x9F;", @@ -76,6 +77,17 @@ foreach ($tests as $t) { } } +echo "\n*** Default options ***\n"; + +foreach ($tests as $t) { + $dec = html_entity_decode($t); + if ($t == $dec) { + echo "$t\tNOT DECODED\n"; + } else { + echo "$t\tDECODED\n"; + } +} + echo "\nDone.\n"; --EXPECT-- *** HTML 4.01 *** @@ -89,6 +101,7 @@ echo "\nDone.\n"; &#x0E; NOT DECODED &#x1F; NOT DECODED &#x20; DECODED +&#x27; DECODED &#x7F; NOT DECODED &#x80; NOT DECODED &#x9F; NOT DECODED @@ -117,6 +130,7 @@ echo "\nDone.\n"; &#x0E; NOT DECODED &#x1F; NOT DECODED &#x20; DECODED +&#x27; DECODED &#x7F; DECODED &#x80; DECODED &#x9F; DECODED @@ -145,6 +159,7 @@ echo "\nDone.\n"; &#x0E; NOT DECODED &#x1F; NOT DECODED &#x20; DECODED +&#x27; DECODED &#x7F; NOT DECODED &#x80; NOT DECODED &#x9F; NOT DECODED @@ -173,6 +188,7 @@ echo "\nDone.\n"; &#x0E; NOT DECODED &#x1F; NOT DECODED &#x20; DECODED +&#x27; DECODED &#x7F; DECODED &#x80; DECODED &#x9F; DECODED @@ -190,4 +206,33 @@ echo "\nDone.\n"; &#x2FFFE; DECODED &#x2FFFF; DECODED +*** Default options *** +&#0; NOT DECODED +&#1; NOT DECODED +&#x09; DECODED +&#x0A; DECODED +&#x0B; NOT DECODED +&#x0C; NOT DECODED +&#x0D; DECODED +&#x0E; NOT DECODED +&#x1F; NOT DECODED +&#x20; DECODED +&#x27; NOT DECODED +&#x7F; NOT DECODED +&#x80; NOT DECODED +&#x9F; NOT DECODED +&#xA0; DECODED +&#xD7FF; DECODED +&#xD800; NOT DECODED +&#xDFFF; NOT DECODED +&#xE000; DECODED +&#xFFFE; DECODED +&#xFFFF; DECODED +&#xFDCF; DECODED +&#xFDD0; DECODED +&#xFDEF; DECODED +&#xFDF0; DECODED +&#x2FFFE; DECODED +&#x2FFFF; DECODED + Done.

« previous php.cvs (#91039) next »