Oihana PHP Arango

assertAttributeName.php

Table of Contents

Functions

assertAttributeName()  : void
Asserts that a string is a safe AQL attribute name (or nested attribute path), throwing when it is not. This is the attribute-path counterpart of {@see assertBindVariable()}: use it before interpolating an untrusted identifier (e.g. a facet sub-field name from the URL) into a `doc.<name>` accessor, to guarantee no AQL injection is possible through the path.

Functions

assertAttributeName()

Asserts that a string is a safe AQL attribute name (or nested attribute path), throwing when it is not. This is the attribute-path counterpart of {@see assertBindVariable()}: use it before interpolating an untrusted identifier (e.g. a facet sub-field name from the URL) into a `doc.<name>` accessor, to guarantee no AQL injection is possible through the path.

assertAttributeName(mixed $value) : void
Parameters
$value : mixed

The attribute name to validate.

Tags
example
use function oihana\arango\db\helpers\assertAttributeName;

assertAttributeName( 'breeding.alternateName' ); // ok
assertAttributeName( 'a || 1==1' );              // throws ValidationException
throws
ValidationException

When $value is not a safe attribute name.

since
1.0.0
author

Marc Alcaraz

On this page

Search results