Strict typing :)

This commit is contained in:
Dustin Wilson 2018-07-26 16:36:35 -05:00
parent 1fc65f85bd
commit 49a04997c9

View file

@ -3351,7 +3351,7 @@ class Parser {
# "html", or the tokens public identifier is not missing, or the tokens system
# identifier is neither missing nor a case-sensitive match for the string
# "about:legacy-compat", then there is a parse error.
if ($token->name !== 'html' || !is_null($token->public) || (!is_null($token->system) && $token->system !== 'about:legacy-compat')) {
if ($token->name !== 'html' || $token->public !== '' || ($token->system !== '' && $token->system !== 'about:legacy-compat')) {
ParseError::trigger(ParseError::INVALID_DOCTYPE, $this->data);
}
@ -3371,7 +3371,7 @@ class Parser {
// an empty name, so if it is missing it is replaced with 'html' instead.
$this->DOM = $imp->createDocument('', '', $imp->createDocumentType((!is_null($token->name)) ? $token->name : 'html', $token->public, $token->system));
$public = strtolower((string)$token->public);
$public = strtolower($token->public);
# Then, if the document is not an iframe srcdoc document, and the DOCTYPE token
# matches one of the conditions in the following list, then set the Document to