This appears to be an issue with Zend's css style query implementation. In Zend/Dom/Query.php, the query function calls a conversion function to convert the query into proper xpath format:
public function query($query)
{
$xpathQuery = Zend_Dom_Query_Css2Xpath::transform($query);
return $this->queryXpath($xpathQuery, $query);
}
However within the transform()
method, they seem to be using some pretty basic regex to split up the string by spaces:
$segments = preg_split('/\s+/', $path);
Which basically means your link[rel="shortcut icon"]
query now becomes two queries: link[rel="shortcut
and icon"]
To get around this, you can use the method Zend_Dom_Query::queryXpath()
and provide it with a proper xPath query. Like this:
$dom->queryXpath('//link[@rel="shortcut icon"]');