ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
HTMLPurifier_IDAccumulator Class Reference

Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes. More...

+ Collaboration diagram for HTMLPurifier_IDAccumulator:

Public Member Functions

 add ($id)
 Add an ID to the lookup table. More...
 
 load ($array_of_ids)
 Load a list of IDs into the lookup table. More...
 

Static Public Member Functions

static build ($config, $context)
 Builds an IDAccumulator, also initializing the default blacklist. More...
 

Data Fields

 $ids = array()
 Lookup table of IDs we've accumulated. More...
 

Detailed Description

Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes.

Note
In Slashdot-speak, dupe means duplicate.
The default constructor does not accept $config or $context objects: use must use the static build() factory method to perform initialization.

Definition at line 9 of file IDAccumulator.php.

Member Function Documentation

◆ add()

HTMLPurifier_IDAccumulator::add (   $id)

Add an ID to the lookup table.

Parameters
string$idID to be added.
Returns
bool status, true if success, false if there's a dupe

Definition at line 36 of file IDAccumulator.php.

References $id.

37  {
38  if (isset($this->ids[$id])) {
39  return false;
40  }
41  return $this->ids[$id] = true;
42  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ build()

static HTMLPurifier_IDAccumulator::build (   $config,
  $context 
)
static

Builds an IDAccumulator, also initializing the default blacklist.

Parameters
HTMLPurifier_Config$configInstance of HTMLPurifier_Config
HTMLPurifier_Context$contextInstance of HTMLPurifier_Context
Returns
HTMLPurifier_IDAccumulator Fully initialized HTMLPurifier_IDAccumulator

Definition at line 24 of file IDAccumulator.php.

References $config.

Referenced by HTMLPurifier\purify(), and HTMLPurifier_AttrValidator\validateToken().

25  {
26  $id_accumulator = new HTMLPurifier_IDAccumulator();
27  $id_accumulator->load($config->get('Attr.IDBlacklist'));
28  return $id_accumulator;
29  }
Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes.
+ Here is the caller graph for this function:

◆ load()

HTMLPurifier_IDAccumulator::load (   $array_of_ids)

Load a list of IDs into the lookup table.

Parameters
$array_of_idsArray of IDs to load
Note
This function doesn't care about duplicates

Definition at line 49 of file IDAccumulator.php.

References $id.

50  {
51  foreach ($array_of_ids as $id) {
52  $this->ids[$id] = true;
53  }
54  }
if(!array_key_exists('StateId', $_REQUEST)) $id

Field Documentation

◆ $ids

HTMLPurifier_IDAccumulator::$ids = array()

Lookup table of IDs we've accumulated.

Definition at line 16 of file IDAccumulator.php.


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