Closed
Description
Description
I don't see any mention on it on the different Dom rfc(the doc is incomplete), but querySelector/querySelectorAll are case sensitive on php, while on browsers like firefox, it is case insensitive
The following code:
<?php
$text = <<<TEXT
<html>
<head>
<meta charset="Windows-1252">
</head>
<body>
</body>
</html>
TEXT;
$dom = \Dom\HTMLDocument::createFromString($text, options: LIBXML_NOERROR);
var_dump($dom->querySelector('meta[charseT]'));
Resulted in this output:
NULL
But I expected this output instead:
object(Dom\HTMLElement)#2 (29) {
["namespaceURI"]=>
string(28) "http://www.w3.org/1999/xhtml"
["prefix"]=>
NULL
["localName"]=>
string(4) "meta"
["tagName"]=>
string(4) "META"
["id"]=>
string(0) ""
["className"]=>
string(0) ""
["classList"]=>
string(22) "(object value omitted)"
["attributes"]=>
string(22) "(object value omitted)"
["firstElementChild"]=>
NULL
["lastElementChild"]=>
NULL
["childElementCount"]=>
int(0)
["previousElementSibling"]=>
NULL
["nextElementSibling"]=>
NULL
["innerHTML"]=>
string(0) ""
["substitutedNodeValue"]=>
string(0) ""
["nodeType"]=>
int(1)
["nodeName"]=>
string(4) "META"
["baseURI"]=>
string(11) "about:blank"
["isConnected"]=>
bool(true)
["ownerDocument"]=>
string(22) "(object value omitted)"
["parentNode"]=>
string(22) "(object value omitted)"
["parentElement"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
NULL
["lastChild"]=>
NULL
["previousSibling"]=>
string(22) "(object value omitted)"
["nextSibling"]=>
string(22) "(object value omitted)"
["nodeValue"]=>
NULL
["textContent"]=>
string(0) ""
}
PHP Version
8.4.4
Operating System
No response