[2.0][Component][DomCrawler] cs
This commit is contained in:
parent
44ba841a67
commit
25fed1355b
@ -621,6 +621,28 @@ class Crawler extends \SplObjectStorage
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts string for XPath expressions.
|
||||
*
|
||||
* Escaped characters are: quotes (") and apostrophe (').
|
||||
*
|
||||
* Examples:
|
||||
* <code>
|
||||
* echo Crawler::xpathLiteral('foo " bar');
|
||||
* //prints 'foo " bar'
|
||||
*
|
||||
* echo Crawler::xpathLiteral("foo ' bar");
|
||||
* //prints "foo ' bar"
|
||||
*
|
||||
* echo Crawler::xpathLiteral('a\'b"c');
|
||||
* //prints concat('a', "'", 'b"c')
|
||||
* </code>
|
||||
*
|
||||
* @param string $s String to be escaped
|
||||
*
|
||||
* @return string Converted string
|
||||
*
|
||||
*/
|
||||
static public function xpathLiteral($s)
|
||||
{
|
||||
if (false === strpos($s, "'")) {
|
||||
|
Reference in New Issue
Block a user