[DomCrawler] Improve the sprintf() call in selectLink()
This commit is contained in:
parent
009b4d216e
commit
e2ab1a47d2
@ -710,10 +710,9 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*/
|
||||
public function selectLink($value)
|
||||
{
|
||||
$xpath = sprintf('descendant-or-self::a[contains(concat(\' \', normalize-space(string(.)), \' \'), %s) ', static::xpathLiteral(' '.$value.' ')).
|
||||
sprintf('or ./img[contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)]]', static::xpathLiteral(' '.$value.' '));
|
||||
|
||||
return $this->filterRelativeXPath($xpath);
|
||||
return $this->filterRelativeXPath(
|
||||
sprintf('descendant-or-self::a[contains(concat(\' \', normalize-space(string(.)), \' \'), %1$s) or ./img[contains(concat(\' \', normalize-space(string(@alt)), \' \'), %1$s)]]', static::xpathLiteral(' '.$value.' '))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user