2006-07-23 00:11:03 +00:00
|
|
|
<?php
|
|
|
|
|
2006-07-23 13:20:15 +00:00
|
|
|
/**
|
|
|
|
* Abstract base token class that all others inherit from.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_Token {
|
2007-11-25 02:24:39 +00:00
|
|
|
public $line; /**< Line number node was on in source document. Null if unknown. */
|
2006-08-20 20:59:13 +00:00
|
|
|
|
2007-06-20 21:39:28 +00:00
|
|
|
/**
|
|
|
|
* Lookup array of processing that this token is exempt from.
|
2007-06-26 15:07:07 +00:00
|
|
|
* Currently, valid values are "ValidateAttributes" and
|
|
|
|
* "MakeWellFormed_TagClosedError"
|
2007-06-20 21:39:28 +00:00
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $armor = array();
|
2007-06-20 21:39:28 +00:00
|
|
|
|
2008-01-19 20:23:01 +00:00
|
|
|
public function __get($n) {
|
|
|
|
if ($n === 'type') {
|
|
|
|
trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE);
|
|
|
|
switch (get_class($this)) {
|
|
|
|
case 'HTMLPurifier_Token_Start': return 'start';
|
|
|
|
case 'HTMLPurifier_Token_Empty': return 'empty';
|
|
|
|
case 'HTMLPurifier_Token_End': return 'end';
|
|
|
|
case 'HTMLPurifier_Token_Text': return 'text';
|
|
|
|
case 'HTMLPurifier_Token_Comment': return 'comment';
|
|
|
|
default: return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-07-23 13:20:15 +00:00
|
|
|
}
|