Skip to content

Commit fd6660f

Browse files
author
Edward Z. Yang ext:(%22)
committed
Fix < produces parse errors in attribute states.
1 parent c97c17e commit fd6660f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

SPEC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
3195
1+
3354
22

33
(this is the last revision of the spec this library has been audited against)

library/HTML5/Tokenizer.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,11 @@ public function parse() {
654654
} else {
655655
/* U+0022 QUOTATION MARK (")
656656
U+0027 APOSTROPHE (')
657+
U+003C LESS-THAN SIGN (<)
657658
U+003D EQUALS SIGN (=)
658659
Parse error. Treat it as per the "anything else" entry
659660
below. */
660-
if($char === '"' || $char === "'" || $char === '=') {
661+
if($char === '"' || $char === "'" || $char === '<' || $char === '=') {
661662
$this->emitToken(array(
662663
'type' => self::PARSEERROR,
663664
'data' => 'invalid-character-in-attribute-name'
@@ -733,9 +734,10 @@ public function parse() {
733734
} else {
734735
/* U+0022 QUOTATION MARK (")
735736
U+0027 APOSTROPHE (')
737+
U+003C LESS-THAN SIGN (<)
736738
Parse error. Treat it as per the "anything else"
737739
entry below. */
738-
if($char === '"' || $char === "'") {
740+
if($char === '"' || $char === "'" || $char === '<') {
739741
$this->emitToken(array(
740742
'type' => self::PARSEERROR,
741743
'data' => 'invalid-character-in-attribute-name'
@@ -820,9 +822,10 @@ public function parse() {
820822
} else {
821823
/* U+0022 QUOTATION MARK (")
822824
U+0027 APOSTROPHE (')
825+
U+003C LESS-THAN SIGN(<)
823826
Parse error. Treat it as per the "anything else"
824827
entry below. */
825-
if($char === '"' || $char === "'") {
828+
if($char === '"' || $char === "'" || $char === "<") {
826829
$this->emitToken(array(
827830
'type' => self::PARSEERROR,
828831
'data' => 'invalid-character-after-attribute-name'
@@ -894,8 +897,9 @@ public function parse() {
894897

895898
} else {
896899
/* U+003D EQUALS SIGN (=)
900+
* U+003C LESS-THAN SIGN (<)
897901
Parse error. Treat it as per the "anything else" entry below. */
898-
if($char === '=') {
902+
if($char === '=' || $char === '<') {
899903
$this->emitToken(array(
900904
'type' => self::PARSEERROR,
901905
'data' => 'equals-in-unquoted-attribute-value'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy