|
Revision 21, 1.0 kB
(checked in by admin, 18 years ago)
|
|
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * Abstract base token class that all others inherit from. |
|---|
| 5 | */ |
|---|
| 6 | class HTMLPurifier_Token { |
|---|
| 7 | public $type; /**< Type of node to bypass <tt>is_a()</tt>. */ |
|---|
| 8 | public $line; /**< Line number node was on in source document. Null if unknown. */ |
|---|
| 9 | |
|---|
| 10 | /** |
|---|
| 11 | * Lookup array of processing that this token is exempt from. |
|---|
| 12 | * Currently, valid values are "ValidateAttributes" and |
|---|
| 13 | * "MakeWellFormed_TagClosedError" |
|---|
| 14 | */ |
|---|
| 15 | public $armor = array(); |
|---|
| 16 | |
|---|
| 17 | public function __get($n) { |
|---|
| 18 | if ($n === 'type') { |
|---|
| 19 | trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE); |
|---|
| 20 | switch (get_class($this)) { |
|---|
| 21 | case 'HTMLPurifier_Token_Start': return 'start'; |
|---|
| 22 | case 'HTMLPurifier_Token_Empty': return 'empty'; |
|---|
| 23 | case 'HTMLPurifier_Token_End': return 'end'; |
|---|
| 24 | case 'HTMLPurifier_Token_Text': return 'text'; |
|---|
| 25 | case 'HTMLPurifier_Token_Comment': return 'comment'; |
|---|
| 26 | default: return null; |
|---|
| 27 | } |
|---|
| 28 | } |
|---|
| 29 | } |
|---|
| 30 | } |
|---|