1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +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

@@ -13,7 +13,7 @@ class HTMLPurifier_ElementDef
* Does the definition work by itself, or is it created solely
* for the purpose of merging into another definition?
*/
var $standalone = true;
public $standalone = true;
/**
* Associative array of attribute name to HTMLPurifier_AttrDef
@@ -25,29 +25,23 @@ class HTMLPurifier_ElementDef
* contain string indentifiers in lieu of HTMLPurifier_AttrDef,
* see HTMLPurifier_AttrTypes on how they are expanded during
* HTMLPurifier_HTMLDefinition->setup() processing.
* @public
*/
var $attr = array();
public $attr = array();
/**
* Indexed list of tag's HTMLPurifier_AttrTransform to be done before validation
* @public
*/
var $attr_transform_pre = array();
public $attr_transform_pre = array();
/**
* Indexed list of tag's HTMLPurifier_AttrTransform to be done after validation
* @public
*/
var $attr_transform_post = array();
public $attr_transform_post = array();
/**
* HTMLPurifier_ChildDef of this tag.
* @public
*/
var $child;
public $child;
/**
* Abstract string representation of internal ChildDef rules. See
@@ -55,9 +49,8 @@ class HTMLPurifier_ElementDef
* into an HTMLPurifier_ChildDef.
* @warning This is a temporary variable that is not available after
* being processed by HTMLDefinition
* @public
*/
var $content_model;
public $content_model;
/**
* Value of $child->type, used to determine which ChildDef to use,
@@ -65,9 +58,8 @@ class HTMLPurifier_ElementDef
* @warning This must be lowercase
* @warning This is a temporary variable that is not available after
* being processed by HTMLDefinition
* @public
*/
var $content_model_type;
public $content_model_type;
@@ -76,16 +68,14 @@ class HTMLPurifier_ElementDef
* is important for chameleon ins and del processing in
* HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't
* have to worry about this one.
* @public
*/
var $descendants_are_inline = false;
public $descendants_are_inline = false;
/**
* List of the names of required attributes this element has. Dynamically
* populated by HTMLPurifier_HTMLDefinition::getElement
* @public
*/
var $required_attr = array();
public $required_attr = array();
/**
* Lookup table of tags excluded from all descendants of this tag.
@@ -97,20 +87,18 @@ class HTMLPurifier_ElementDef
* all descendants and not just children. Note that the XHTML
* Modularization Abstract Modules are blithely unaware of such
* distinctions.
* @public
*/
var $excludes = array();
public $excludes = array();
/**
* Is this element safe for untrusted users to use?
*/
var $safe;
public $safe;
/**
* Low-level factory constructor for creating new standalone element defs
* @static
*/
function create($safe, $content_model, $content_model_type, $attr) {
public static function create($safe, $content_model, $content_model_type, $attr) {
$def = new HTMLPurifier_ElementDef();
$def->safe = (bool) $safe;
$def->content_model = $content_model;
@@ -124,7 +112,7 @@ class HTMLPurifier_ElementDef
* Values from the new element def take precedence if a value is
* not mergeable.
*/
function mergeIn($def) {
public function mergeIn($def) {
// later keys takes precedence
foreach($def->attr as $k => $v) {
@@ -165,7 +153,7 @@ class HTMLPurifier_ElementDef
* @param $a1 Array by reference that is merged into
* @param $a2 Array that merges into $a1
*/
function _mergeAssocArray(&$a1, $a2) {
private function _mergeAssocArray(&$a1, $a2) {
foreach ($a2 as $k => $v) {
if ($v === false) {
if (isset($a1[$k])) unset($a1[$k]);
@@ -178,7 +166,7 @@ class HTMLPurifier_ElementDef
/**
* Retrieves a copy of the element definition
*/
function copy() {
public function copy() {
return unserialize(serialize($this));
}