You are here

private function NodeExtension::isSafeName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/XPath/Extension/NodeExtension.php \Symfony\Component\CssSelector\XPath\Extension\NodeExtension::isSafeName()

Tests if given name is safe.

Parameters

string $name:

Return value

bool

2 calls to NodeExtension::isSafeName()
NodeExtension::translateAttribute in vendor/symfony/css-selector/XPath/Extension/NodeExtension.php
NodeExtension::translateElement in vendor/symfony/css-selector/XPath/Extension/NodeExtension.php

File

vendor/symfony/css-selector/XPath/Extension/NodeExtension.php, line 267

Class

NodeExtension
XPath expression translator node extension.

Namespace

Symfony\Component\CssSelector\XPath\Extension

Code

private function isSafeName($name) {
  return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name);
}