1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 06:07:26 +02:00

Convert to PHP 5 only codebase, adding visibility modifiers to all members and methods in the main library area (function only for test methods)

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1458 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-11-25 02:24:39 +00:00
parent 85a23bacb6
commit 43f01925cd
195 changed files with 1003 additions and 1064 deletions

View File

@@ -10,21 +10,21 @@
* Abstract base token class that all others inherit from.
*/
class HTMLPurifier_Token {
var $type; /**< Type of node to bypass <tt>is_a()</tt>. @public */
var $line; /**< Line number node was on in source document. Null if unknown. @public */
public $type; /**< Type of node to bypass <tt>is_a()</tt>. */
public $line; /**< Line number node was on in source document. Null if unknown. */
/**
* Lookup array of processing that this token is exempt from.
* Currently, valid values are "ValidateAttributes" and
* "MakeWellFormed_TagClosedError"
*/
var $armor = array();
public $armor = array();
/**
* Copies the tag into a new one (clone substitute).
* @return Copied token
*/
function copy() {
public function copy() {
return unserialize(serialize($this));
}
}
@@ -39,10 +39,8 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
*
* This allows us to check objects with <tt>!empty($obj->is_tag)</tt>
* without having to use a function call <tt>is_a()</tt>.
*
* @public
*/
var $is_tag = true;
public $is_tag = true;
/**
* The lower-case name of the tag, like 'a', 'b' or 'blockquote'.
@@ -50,15 +48,13 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
* @note Strictly speaking, XML tags are case sensitive, so we shouldn't
* be lower-casing them, but these tokens cater to HTML tags, which are
* insensitive.
*
* @public
*/
var $name;
public $name;
/**
* Associative array of the tag's attributes.
*/
var $attr = array();
public $attr = array();
/**
* Non-overloaded constructor, which lower-cases passed tag name.
@@ -66,7 +62,7 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
* @param $name String name.
* @param $attr Associative array of attributes.
*/
function HTMLPurifier_Token_Tag($name, $attr = array(), $line = null) {
public function HTMLPurifier_Token_Tag($name, $attr = array(), $line = null) {
$this->name = ctype_lower($name) ? $name : strtolower($name);
foreach ($attr as $key => $value) {
// normalization only necessary when key is not lowercase
@@ -90,7 +86,7 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
*/
class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag
{
var $type = 'start';
public $type = 'start';
}
/**
@@ -98,7 +94,7 @@ class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag
*/
class HTMLPurifier_Token_Empty extends HTMLPurifier_Token_Tag
{
var $type = 'empty';
public $type = 'empty';
}
/**
@@ -110,7 +106,7 @@ class HTMLPurifier_Token_Empty extends HTMLPurifier_Token_Tag
*/
class HTMLPurifier_Token_End extends HTMLPurifier_Token_Tag
{
var $type = 'end';
public $type = 'end';
}
/**
@@ -125,17 +121,17 @@ class HTMLPurifier_Token_End extends HTMLPurifier_Token_Tag
class HTMLPurifier_Token_Text extends HTMLPurifier_Token
{
var $name = '#PCDATA'; /**< PCDATA tag name compatible with DTD. @public */
var $type = 'text';
var $data; /**< Parsed character data of text. @public */
var $is_whitespace; /**< Bool indicating if node is whitespace. @public */
public $name = '#PCDATA'; /**< PCDATA tag name compatible with DTD. */
public $type = 'text';
public $data; /**< Parsed character data of text. */
public $is_whitespace; /**< Bool indicating if node is whitespace. */
/**
* Constructor, accepts data and determines if it is whitespace.
*
* @param $data String parsed character data.
*/
function HTMLPurifier_Token_Text($data, $line = null) {
public function HTMLPurifier_Token_Text($data, $line = null) {
$this->data = $data;
$this->is_whitespace = ctype_space($data);
$this->line = $line;
@@ -148,14 +144,14 @@ class HTMLPurifier_Token_Text extends HTMLPurifier_Token
*/
class HTMLPurifier_Token_Comment extends HTMLPurifier_Token
{
var $data; /**< Character data within comment. @public */
var $type = 'comment';
public $data; /**< Character data within comment. */
public $type = 'comment';
/**
* Transparent constructor.
*
* @param $data String comment data.
*/
function HTMLPurifier_Token_Comment($data, $line = null) {
public function HTMLPurifier_Token_Comment($data, $line = null) {
$this->data = $data;
$this->line = $line;
}