Skip to content

Commit ab24fee

Browse files
committed
Mozilla bug 1469580 - Ignore charset= in <meta content> if followed by unmatched quote. r=mrbkap.
1 parent 24571ca commit ab24fee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/nu/validator/htmlparser/impl/TreeBuilder.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3298,17 +3298,20 @@ public static String extractCharsetFromContent(String attributeValue
32983298
}
32993299
}
33003300
}
3301-
String charset = null;
33023301
if (start != -1) {
33033302
if (end == -1) {
3304-
end = buffer.length;
3303+
if (charsetState == CHARSET_UNQUOTED) {
3304+
end = buffer.length;
3305+
} else {
3306+
return null;
3307+
}
33053308
}
3306-
charset = Portability.newStringFromBuffer(buffer, start, end
3309+
return Portability.newStringFromBuffer(buffer, start, end
33073310
- start
33083311
// CPPONLY: , tb, false
33093312
);
33103313
}
3311-
return charset;
3314+
return null;
33123315
}
33133316

33143317
private void checkMetaCharset(HtmlAttributes attributes)

0 commit comments

Comments
 (0)