summaryrefslogtreecommitdiff
path: root/test/HTML5/Parser
diff options
context:
space:
mode:
authorMatt Butcher <[email protected]>2014-02-11 10:03:12 -0700
committerMatt Butcher <[email protected]>2014-02-11 10:03:12 -0700
commit890cb84578d3b9a7ea63314a06f826a67be441d2 (patch)
treeb000902c9500bf232d739adbfdf3c6c1eb654390 /test/HTML5/Parser
parent44e8e23626bf619844baf9983e931d2f58606377 (diff)
parenta1e7f337a4bab48a55e0b5f5cf4c6a2da1530ade (diff)
Merge pull request #28 from miso-belica/fix-infinite-cycle
Fixed infinite loop for char "&" in unquoted attribute
Diffstat (limited to 'test/HTML5/Parser')
-rw-r--r--test/HTML5/Parser/TokenizerTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php
index 231827c..a55250f 100644
--- a/test/HTML5/Parser/TokenizerTest.php
+++ b/test/HTML5/Parser/TokenizerTest.php
@@ -109,7 +109,7 @@ class TokenizerTest extends \HTML5\Tests\TestCase {
$e1 = $events->get(0);
$this->assertEquals('error', $e1['name']);
- // FIXME: Once the text processor is done, need to verify that the
+ // FIXME: Once the text processor is done, need to verify that the
// tokens are transformed correctly into text.
}
@@ -139,12 +139,12 @@ class TokenizerTest extends \HTML5\Tests\TestCase {
$succeed = array(
'</a>' => 'a',
'</test>' => 'test',
- '</test
+ '</test
>' => 'test',
'</thisIsTheTagThatDoesntEndItJustGoesOnAndOnMyFriend>' =>
'thisisthetagthatdoesntenditjustgoesonandonmyfriend',
// See 8.2.4.10, which requires this and does not say error.
- '</a<b>' => 'a<b',
+ '</a<b>' => 'a<b',
);
$this->isAllGood('endTag', 2, $succeed);
@@ -271,8 +271,8 @@ class TokenizerTest extends \HTML5\Tests\TestCase {
public function testProcessorInstruction() {
$good = array(
'<?hph ?>' => 'hph',
- '<?hph echo "Hello World"; ?>' => array('hph', 'echo "Hello World"; '),
- "<?hph \necho 'Hello World';\n?>" => array('hph', "echo 'Hello World';\n"),
+ '<?hph echo "Hello World"; ?>' => array('hph', 'echo "Hello World"; '),
+ "<?hph \necho 'Hello World';\n?>" => array('hph', "echo 'Hello World';\n"),
);
$this->isAllGood('pi', 2, $good);
}
@@ -379,6 +379,8 @@ class TokenizerTest extends \HTML5\Tests\TestCase {
$reallyBad = array(
'<foo ="bar">' => array('foo', array('=' => NULL, '"bar"' => NULL), FALSE),
'<foo////>' => array('foo', array(), TRUE),
+ // character "&" in unquoted attribute shouldn't cause an infinite loop
+ '<foo bar=index.php?str=1&amp;id=29>' => array('foo', array('bar' => 'index.php?str=1&id=29'), FALSE),
);
foreach ($reallyBad as $test => $expects) {
$events = $this->parse($test);