ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
RobRichards\XMLSecLibs\Utils\XPath Class Reference
+ Collaboration diagram for RobRichards\XMLSecLibs\Utils\XPath:

Static Public Member Functions

static filterAttrValue ($value, $quotes=self::ALL_QUOTES)
 Filter an attribute value for save inclusion in an XPath query. More...
 
static filterAttrName ($name, $allow=self::EXTENDED_ALPHANUMERIC)
 Filter an attribute name for save inclusion in an XPath query. More...
 

Data Fields

const ALPHANUMERIC = '\w\d'
 
const NUMERIC = '\d'
 
const LETTERS = '\w'
 
const EXTENDED_ALPHANUMERIC = '\w\d\s\-_:\.'
 
const SINGLE_QUOTE = '\''
 
const DOUBLE_QUOTE = '"'
 
const ALL_QUOTES = '[\'"]'
 

Detailed Description

Definition at line 5 of file XPath.php.

Member Function Documentation

◆ filterAttrName()

static RobRichards\XMLSecLibs\Utils\XPath::filterAttrName (   $name,
  $allow = self::EXTENDED_ALPHANUMERIC 
)
static

Filter an attribute name for save inclusion in an XPath query.

Parameters
string$nameThe attribute name to filter.
mixed$allowThe set of characters to allow. Can be one of the constants provided by this class, or a custom regex excluding the '#' character (used as delimiter).
Returns
string The filtered attribute name.

Definition at line 40 of file XPath.php.

References $name.

41  {
42  return preg_replace('#[^'.$allow.']#', '', $name);
43  }
if($format !==null) $name
Definition: metadata.php:146

◆ filterAttrValue()

static RobRichards\XMLSecLibs\Utils\XPath::filterAttrValue (   $value,
  $quotes = self::ALL_QUOTES 
)
static

Filter an attribute value for save inclusion in an XPath query.

Parameters
string$valueThe value to filter.
string$quotesThe quotes used to delimit the value in the XPath query.
Returns
string The filtered attribute value.

Definition at line 25 of file XPath.php.

26  {
27  return preg_replace('#'.$quotes.'#', '', $value);
28  }

Field Documentation

◆ ALL_QUOTES

const RobRichards\XMLSecLibs\Utils\XPath::ALL_QUOTES = '[\'"]'

Definition at line 14 of file XPath.php.

◆ ALPHANUMERIC

const RobRichards\XMLSecLibs\Utils\XPath::ALPHANUMERIC = '\w\d'

Definition at line 7 of file XPath.php.

◆ DOUBLE_QUOTE

const RobRichards\XMLSecLibs\Utils\XPath::DOUBLE_QUOTE = '"'

Definition at line 13 of file XPath.php.

◆ EXTENDED_ALPHANUMERIC

const RobRichards\XMLSecLibs\Utils\XPath::EXTENDED_ALPHANUMERIC = '\w\d\s\-_:\.'

Definition at line 10 of file XPath.php.

◆ LETTERS

const RobRichards\XMLSecLibs\Utils\XPath::LETTERS = '\w'

Definition at line 9 of file XPath.php.

◆ NUMERIC

const RobRichards\XMLSecLibs\Utils\XPath::NUMERIC = '\d'

Definition at line 8 of file XPath.php.

◆ SINGLE_QUOTE

const RobRichards\XMLSecLibs\Utils\XPath::SINGLE_QUOTE = '\''

Definition at line 12 of file XPath.php.


The documentation for this class was generated from the following file: