What steps will reproduce the problem?
1. Add a new HTML document to the class containing a HEAD tag with any
attribute(s)
2. Use the object of the class as a string (example: $str =
(string)$phpQueryObject;)
3. The HEAD tag disappeared
Version: 0.9.5 (latest)
I managed to find the problem and solve it. here's how:
In function charsetFixHTML, find the command
$headStart = stripos($markup, '<head>');
This is not allways true, since when the HEAD has attributes, the stripos won't
find it and return false.
I replaced it with:
$headStart = preg_match("/<head([\w\W]+?)>/i",$markup,$captures, PREG_OFFSET_CAPTURE);
if ($headStart > 0) {
$headStart = $captures[0][1];
} else {
$headStart = false;
}
Works like a charm
Original issue reported on code.google.com by GalTom...@gmail.com on 3 Feb 2012 at 2:20
Original issue reported on code.google.com by
GalTom...@gmail.com
on 3 Feb 2012 at 2:20