You are here

private function NamedSelector::escapeLocator in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/src/Selector/NamedSelector.php \Behat\Mink\Selector\NamedSelector::escapeLocator()
1 call to NamedSelector::escapeLocator()
NamedSelector::translateToXPath in vendor/behat/mink/src/Selector/NamedSelector.php
Translates provided locator into XPath.

File

vendor/behat/mink/src/Selector/NamedSelector.php, line 244

Class

NamedSelector
Named selectors engine. Uses registered XPath selectors to create new expressions.

Namespace

Behat\Mink\Selector

Code

private function escapeLocator($locator) {

  // If the locator looks like an escaped one, don't escape it again for BC reasons.
  if (preg_match('/^\'[^\']*+\'$/', $locator) || false !== strpos($locator, '\'') && preg_match('/^"[^"]*+"$/', $locator) || 8 < ($length = strlen($locator)) && 'concat(' === substr($locator, 0, 7) && ')' === $locator[$length - 1]) {
    @trigger_error('Passing an escaped locator to the named selector is deprecated as of 1.7 and will be removed in 2.0.' . ' Pass the raw value instead.', E_USER_DEPRECATED);
    return $locator;
  }
  return $this->xpathEscaper
    ->escapeLiteral($locator);
}