From 3ef9bdf8a2c69d4f94b8eecc226af74432fe66d4 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 29 Nov 2007 04:29:51 +0000 Subject: [PATCH] __construct'ify all main library classes. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1459 48356398-32a2-884e-a903-53898d9a118a --- NEWS | 1 + library/HTMLPurifier.php | 2 +- library/HTMLPurifier/AttrCollections.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Background.php | 2 +- .../HTMLPurifier/AttrDef/CSS/BackgroundPosition.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Border.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Composite.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Font.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Length.php | 2 +- library/HTMLPurifier/AttrDef/CSS/ListStyle.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Multiple.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Number.php | 2 +- library/HTMLPurifier/AttrDef/CSS/Percentage.php | 2 +- library/HTMLPurifier/AttrDef/CSS/URI.php | 4 ++-- library/HTMLPurifier/AttrDef/Enum.php | 2 +- library/HTMLPurifier/AttrDef/HTML/Bool.php | 2 +- library/HTMLPurifier/AttrDef/HTML/FrameTarget.php | 2 +- library/HTMLPurifier/AttrDef/HTML/LinkTypes.php | 2 +- library/HTMLPurifier/AttrDef/Integer.php | 2 +- library/HTMLPurifier/AttrDef/URI.php | 2 +- library/HTMLPurifier/AttrDef/URI/Host.php | 2 +- library/HTMLPurifier/AttrTransform/BoolToCSS.php | 2 +- library/HTMLPurifier/AttrTransform/EnumToCSS.php | 2 +- library/HTMLPurifier/AttrTransform/ImgSpace.php | 2 +- library/HTMLPurifier/AttrTransform/Length.php | 2 +- library/HTMLPurifier/AttrTypes.php | 2 +- library/HTMLPurifier/ChildDef/Chameleon.php | 2 +- library/HTMLPurifier/ChildDef/Custom.php | 2 +- library/HTMLPurifier/ChildDef/Empty.php | 2 +- library/HTMLPurifier/ChildDef/Required.php | 2 +- library/HTMLPurifier/ChildDef/Table.php | 2 +- library/HTMLPurifier/Config.php | 2 +- library/HTMLPurifier/ConfigDef/Directive.php | 2 +- library/HTMLPurifier/ConfigDef/DirectiveAlias.php | 2 +- library/HTMLPurifier/ContentSets.php | 2 +- library/HTMLPurifier/DefinitionCache.php | 2 +- library/HTMLPurifier/DefinitionCache/Decorator.php | 2 +- library/HTMLPurifier/Doctype.php | 2 +- library/HTMLPurifier/Encoder.php | 2 +- library/HTMLPurifier/ErrorCollector.php | 2 +- library/HTMLPurifier/HTMLDefinition.php | 2 +- library/HTMLPurifier/HTMLModule/Bdo.php | 2 +- library/HTMLPurifier/HTMLModule/Edit.php | 2 +- library/HTMLPurifier/HTMLModule/Hypertext.php | 2 +- library/HTMLPurifier/HTMLModule/Image.php | 2 +- library/HTMLPurifier/HTMLModule/Legacy.php | 2 +- library/HTMLPurifier/HTMLModule/List.php | 2 +- library/HTMLPurifier/HTMLModule/Object.php | 2 +- library/HTMLPurifier/HTMLModule/Presentation.php | 2 +- library/HTMLPurifier/HTMLModule/Ruby.php | 2 +- library/HTMLPurifier/HTMLModule/Scripting.php | 2 +- library/HTMLPurifier/HTMLModule/StyleAttribute.php | 2 +- library/HTMLPurifier/HTMLModule/Tables.php | 2 +- library/HTMLPurifier/HTMLModule/Target.php | 2 +- library/HTMLPurifier/HTMLModule/Text.php | 2 +- library/HTMLPurifier/HTMLModuleManager.php | 2 +- library/HTMLPurifier/Language.php | 2 +- library/HTMLPurifier/Lexer.php | 2 +- library/HTMLPurifier/Lexer/DOMLex.php | 2 +- library/HTMLPurifier/Printer.php | 2 +- library/HTMLPurifier/Printer/ConfigForm.php | 4 ++-- library/HTMLPurifier/TagTransform/Simple.php | 2 +- library/HTMLPurifier/Token.php | 6 +++--- library/HTMLPurifier/TokenFactory.php | 10 +++++----- library/HTMLPurifier/URI.php | 2 +- library/HTMLPurifier/URIDefinition.php | 2 +- tests/HTMLPurifier/AttrCollectionsTest.php | 2 +- 67 files changed, 75 insertions(+), 74 deletions(-) diff --git a/NEWS b/NEWS index 611f6687..58922a7e 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier until PHP 4 is completely deprecated, but no new features will be added to it. + Visibility declarations added + + Constructor methods renamed to __construct() 2.1.3, released 2007-11-05 ! tests/multitest.php allows you to test multiple versions by running diff --git a/library/HTMLPurifier.php b/library/HTMLPurifier.php index ba5f7c52..3ea1098d 100644 --- a/library/HTMLPurifier.php +++ b/library/HTMLPurifier.php @@ -105,7 +105,7 @@ class HTMLPurifier * The parameter can also be any type that * HTMLPurifier_Config::create() supports. */ - public function HTMLPurifier($config = null) { + public function __construct($config = null) { $this->config = HTMLPurifier_Config::create($config); diff --git a/library/HTMLPurifier/AttrCollections.php b/library/HTMLPurifier/AttrCollections.php index 4ea54b26..c50a8b24 100644 --- a/library/HTMLPurifier/AttrCollections.php +++ b/library/HTMLPurifier/AttrCollections.php @@ -21,7 +21,7 @@ class HTMLPurifier_AttrCollections * @param $attr_types HTMLPurifier_AttrTypes instance * @param $modules Hash array of HTMLPurifier_HTMLModule members */ - public function HTMLPurifier_AttrCollections($attr_types, $modules) { + public function __construct($attr_types, $modules) { // load extensions from the modules foreach ($modules as $module) { foreach ($module->attr_collections as $coll_i => $coll) { diff --git a/library/HTMLPurifier/AttrDef/CSS/Background.php b/library/HTMLPurifier/AttrDef/CSS/Background.php index 3fee72a6..9812c7b2 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Background.php +++ b/library/HTMLPurifier/AttrDef/CSS/Background.php @@ -16,7 +16,7 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef */ protected $info; - public function HTMLPurifier_AttrDef_CSS_Background($config) { + public function __construct($config) { $def = $config->getCSSDefinition(); $this->info['background-color'] = $def->info['background-color']; $this->info['background-image'] = $def->info['background-image']; diff --git a/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php index 007d4b14..38319926 100644 --- a/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php +++ b/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php @@ -51,7 +51,7 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef protected $length; protected $percentage; - public function HTMLPurifier_AttrDef_CSS_BackgroundPosition() { + public function __construct() { $this->length = new HTMLPurifier_AttrDef_CSS_Length(); $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); } diff --git a/library/HTMLPurifier/AttrDef/CSS/Border.php b/library/HTMLPurifier/AttrDef/CSS/Border.php index d4f20b05..63640519 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Border.php +++ b/library/HTMLPurifier/AttrDef/CSS/Border.php @@ -13,7 +13,7 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef */ protected $info = array(); - public function HTMLPurifier_AttrDef_CSS_Border($config) { + public function __construct($config) { $def = $config->getCSSDefinition(); $this->info['border-width'] = $def->info['border-width']; $this->info['border-style'] = $def->info['border-style']; diff --git a/library/HTMLPurifier/AttrDef/CSS/Composite.php b/library/HTMLPurifier/AttrDef/CSS/Composite.php index 9feae330..1b6c8ad4 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Composite.php +++ b/library/HTMLPurifier/AttrDef/CSS/Composite.php @@ -21,7 +21,7 @@ class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef /** * @param $defs List of HTMLPurifier_AttrDef objects */ - public function HTMLPurifier_AttrDef_CSS_Composite($defs) { + public function __construct($defs) { $this->defs = $defs; } diff --git a/library/HTMLPurifier/AttrDef/CSS/Font.php b/library/HTMLPurifier/AttrDef/CSS/Font.php index e1477bcf..2b6b6795 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Font.php +++ b/library/HTMLPurifier/AttrDef/CSS/Font.php @@ -18,7 +18,7 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef */ protected $info = array(); - public function HTMLPurifier_AttrDef_CSS_Font($config) { + public function __construct($config) { $def = $config->getCSSDefinition(); $this->info['font-style'] = $def->info['font-style']; $this->info['font-variant'] = $def->info['font-variant']; diff --git a/library/HTMLPurifier/AttrDef/CSS/Length.php b/library/HTMLPurifier/AttrDef/CSS/Length.php index 2a29d68d..222bc1bd 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Length.php +++ b/library/HTMLPurifier/AttrDef/CSS/Length.php @@ -25,7 +25,7 @@ class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef * @param $non_negative Bool indication whether or not negative values are * allowed. */ - public function HTMLPurifier_AttrDef_CSS_Length($non_negative = false) { + public function __construct($non_negative = false) { $this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); } diff --git a/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/library/HTMLPurifier/AttrDef/CSS/ListStyle.php index 2ee7145c..99e044a1 100644 --- a/library/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ b/library/HTMLPurifier/AttrDef/CSS/ListStyle.php @@ -15,7 +15,7 @@ class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef */ protected $info; - public function HTMLPurifier_AttrDef_CSS_ListStyle($config) { + public function __construct($config) { $def = $config->getCSSDefinition(); $this->info['list-style-type'] = $def->info['list-style-type']; $this->info['list-style-position'] = $def->info['list-style-position']; diff --git a/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/library/HTMLPurifier/AttrDef/CSS/Multiple.php index 83e4f85f..e41637e2 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Multiple.php +++ b/library/HTMLPurifier/AttrDef/CSS/Multiple.php @@ -32,7 +32,7 @@ class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef * @param $single HTMLPurifier_AttrDef to multiply * @param $max Max number of values allowed (usually four) */ - public function HTMLPurifier_AttrDef_CSS_Multiple($single, $max = 4) { + public function __construct($single, $max = 4) { $this->single = $single; $this->max = $max; } diff --git a/library/HTMLPurifier/AttrDef/CSS/Number.php b/library/HTMLPurifier/AttrDef/CSS/Number.php index e837f561..228600c9 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Number.php +++ b/library/HTMLPurifier/AttrDef/CSS/Number.php @@ -14,7 +14,7 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef /** * @param $non_negative Bool indicating whether negatives are forbidden */ - public function HTMLPurifier_AttrDef_CSS_Number($non_negative = false) { + public function __construct($non_negative = false) { $this->non_negative = $non_negative; } diff --git a/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/library/HTMLPurifier/AttrDef/CSS/Percentage.php index 3ca2c955..3804a0a9 100644 --- a/library/HTMLPurifier/AttrDef/CSS/Percentage.php +++ b/library/HTMLPurifier/AttrDef/CSS/Percentage.php @@ -17,7 +17,7 @@ class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef /** * @param Bool indicating whether to forbid negative values */ - public function HTMLPurifier_AttrDef_CSS_Percentage($non_negative = false) { + public function __construct($non_negative = false) { $this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); } diff --git a/library/HTMLPurifier/AttrDef/CSS/URI.php b/library/HTMLPurifier/AttrDef/CSS/URI.php index 1519ac7e..b4b87174 100644 --- a/library/HTMLPurifier/AttrDef/CSS/URI.php +++ b/library/HTMLPurifier/AttrDef/CSS/URI.php @@ -14,8 +14,8 @@ require_once 'HTMLPurifier/AttrDef/URI.php'; class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI { - public function HTMLPurifier_AttrDef_CSS_URI() { - parent::HTMLPurifier_AttrDef_URI(true); // always embedded + public function __construct() { + parent::__construct(true); // always embedded } public function validate($uri_string, $config, &$context) { diff --git a/library/HTMLPurifier/AttrDef/Enum.php b/library/HTMLPurifier/AttrDef/Enum.php index 671ecdd5..1219b593 100644 --- a/library/HTMLPurifier/AttrDef/Enum.php +++ b/library/HTMLPurifier/AttrDef/Enum.php @@ -28,7 +28,7 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef * @param $valid_values List of valid values * @param $case_sensitive Bool indicating whether or not case sensitive */ - public function HTMLPurifier_AttrDef_Enum( + public function __construct( $valid_values = array(), $case_sensitive = false ) { $this->valid_values = array_flip($valid_values); diff --git a/library/HTMLPurifier/AttrDef/HTML/Bool.php b/library/HTMLPurifier/AttrDef/HTML/Bool.php index 355fe53c..5962d91f 100644 --- a/library/HTMLPurifier/AttrDef/HTML/Bool.php +++ b/library/HTMLPurifier/AttrDef/HTML/Bool.php @@ -11,7 +11,7 @@ class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef protected $name; public $minimized = true; - public function HTMLPurifier_AttrDef_HTML_Bool($name = false) {$this->name = $name;} + public function __construct($name = false) {$this->name = $name;} public function validate($string, $config, &$context) { if (empty($string)) return false; diff --git a/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php index ca76291a..0bb2f47d 100644 --- a/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ b/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php @@ -22,7 +22,7 @@ class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum public $valid_values = false; // uninitialized value protected $case_sensitive = false; - public function HTMLPurifier_AttrDef_HTML_FrameTarget() {} + public function __construct() {} public function validate($string, $config, &$context) { if ($this->valid_values === false) $this->valid_values = $config->get('Attr', 'AllowedFrameTargets'); diff --git a/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php index 50eeb3fe..d8a128ab 100644 --- a/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php +++ b/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php @@ -29,7 +29,7 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef /** Name config attribute to pull. */ protected $name; - public function HTMLPurifier_AttrDef_HTML_LinkTypes($name) { + public function __construct($name) { $configLookup = array( 'rel' => 'AllowedRel', 'rev' => 'AllowedRev' diff --git a/library/HTMLPurifier/AttrDef/Integer.php b/library/HTMLPurifier/AttrDef/Integer.php index 9c329fd6..68385d0e 100644 --- a/library/HTMLPurifier/AttrDef/Integer.php +++ b/library/HTMLPurifier/AttrDef/Integer.php @@ -32,7 +32,7 @@ class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef * @param $zero Bool indicating whether or not zero is allowed * @param $positive Bool indicating whether or not positive values are allowed */ - public function HTMLPurifier_AttrDef_Integer( + public function __construct( $negative = true, $zero = true, $positive = true ) { $this->negative = $negative; diff --git a/library/HTMLPurifier/AttrDef/URI.php b/library/HTMLPurifier/AttrDef/URI.php index b355055a..7bb3af50 100644 --- a/library/HTMLPurifier/AttrDef/URI.php +++ b/library/HTMLPurifier/AttrDef/URI.php @@ -74,7 +74,7 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef /** * @param $embeds_resource_resource Does the URI here result in an extra HTTP request? */ - public function HTMLPurifier_AttrDef_URI($embeds_resource = false) { + public function __construct($embeds_resource = false) { $this->parser = new HTMLPurifier_URIParser(); $this->percentEncoder = new HTMLPurifier_PercentEncoder(); $this->embedsResource = (bool) $embeds_resource; diff --git a/library/HTMLPurifier/AttrDef/URI/Host.php b/library/HTMLPurifier/AttrDef/URI/Host.php index 866ab5b6..635b40de 100644 --- a/library/HTMLPurifier/AttrDef/URI/Host.php +++ b/library/HTMLPurifier/AttrDef/URI/Host.php @@ -20,7 +20,7 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef */ protected $ipv6; - public function HTMLPurifier_AttrDef_URI_Host() { + public function __construct() { $this->ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); } diff --git a/library/HTMLPurifier/AttrTransform/BoolToCSS.php b/library/HTMLPurifier/AttrTransform/BoolToCSS.php index 5216119f..a7e793ab 100644 --- a/library/HTMLPurifier/AttrTransform/BoolToCSS.php +++ b/library/HTMLPurifier/AttrTransform/BoolToCSS.php @@ -22,7 +22,7 @@ extends HTMLPurifier_AttrTransform { * @param $attr string attribute name to convert from * @param $css string CSS declarations to add to style (needs semicolon) */ - public function HTMLPurifier_AttrTransform_BoolToCSS($attr, $css) { + public function __construct($attr, $css) { $this->attr = $attr; $this->css = $css; } diff --git a/library/HTMLPurifier/AttrTransform/EnumToCSS.php b/library/HTMLPurifier/AttrTransform/EnumToCSS.php index 3a97d880..93f26157 100644 --- a/library/HTMLPurifier/AttrTransform/EnumToCSS.php +++ b/library/HTMLPurifier/AttrTransform/EnumToCSS.php @@ -30,7 +30,7 @@ class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform { * @param $enumToCSS Lookup array of attribute values to CSS * @param $case_sensitive Boolean case sensitivity indicator, default false */ - public function HTMLPurifier_AttrTransform_EnumToCSS($attr, $enum_to_css, $case_sensitive = false) { + public function __construct($attr, $enum_to_css, $case_sensitive = false) { $this->attr = $attr; $this->enumToCSS = $enum_to_css; $this->caseSensitive = (bool) $case_sensitive; diff --git a/library/HTMLPurifier/AttrTransform/ImgSpace.php b/library/HTMLPurifier/AttrTransform/ImgSpace.php index 5af2b845..7fc2718d 100644 --- a/library/HTMLPurifier/AttrTransform/ImgSpace.php +++ b/library/HTMLPurifier/AttrTransform/ImgSpace.php @@ -13,7 +13,7 @@ class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTransform { 'vspace' => array('top', 'bottom') ); - public function HTMLPurifier_AttrTransform_ImgSpace($attr) { + public function __construct($attr) { $this->attr = $attr; if (!isset($this->css[$attr])) { trigger_error(htmlspecialchars($attr) . ' is not valid space attribute'); diff --git a/library/HTMLPurifier/AttrTransform/Length.php b/library/HTMLPurifier/AttrTransform/Length.php index 1e45436f..88ecfae5 100644 --- a/library/HTMLPurifier/AttrTransform/Length.php +++ b/library/HTMLPurifier/AttrTransform/Length.php @@ -11,7 +11,7 @@ class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform protected $name; protected $cssName; - public function HTMLPurifier_AttrTransform_Length($name, $css_name = null) { + public function __construct($name, $css_name = null) { $this->name = $name; $this->cssName = $css_name ? $css_name : $name; } diff --git a/library/HTMLPurifier/AttrTypes.php b/library/HTMLPurifier/AttrTypes.php index 42c1cca5..1748619e 100644 --- a/library/HTMLPurifier/AttrTypes.php +++ b/library/HTMLPurifier/AttrTypes.php @@ -27,7 +27,7 @@ class HTMLPurifier_AttrTypes * Constructs the info array, supplying default implementations for attribute * types. */ - public function HTMLPurifier_AttrTypes() { + public function __construct() { // pseudo-types, must be instantiated via shorthand $this->info['Enum'] = new HTMLPurifier_AttrDef_Enum(); $this->info['Bool'] = new HTMLPurifier_AttrDef_HTML_Bool(); diff --git a/library/HTMLPurifier/ChildDef/Chameleon.php b/library/HTMLPurifier/ChildDef/Chameleon.php index fdbe35e3..5da8eb39 100644 --- a/library/HTMLPurifier/ChildDef/Chameleon.php +++ b/library/HTMLPurifier/ChildDef/Chameleon.php @@ -30,7 +30,7 @@ class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef * @param $inline List of elements to allow when inline. * @param $block List of elements to allow when block. */ - public function HTMLPurifier_ChildDef_Chameleon($inline, $block) { + public function __construct($inline, $block) { $this->inline = new HTMLPurifier_ChildDef_Optional($inline); $this->block = new HTMLPurifier_ChildDef_Optional($block); $this->elements = $this->block->elements; diff --git a/library/HTMLPurifier/ChildDef/Custom.php b/library/HTMLPurifier/ChildDef/Custom.php index 28d19768..a51c3c91 100644 --- a/library/HTMLPurifier/ChildDef/Custom.php +++ b/library/HTMLPurifier/ChildDef/Custom.php @@ -26,7 +26,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef /** * @param $dtd_regex Allowed child pattern from the DTD */ - public function HTMLPurifier_ChildDef_Custom($dtd_regex) { + public function __construct($dtd_regex) { $this->dtd_regex = $dtd_regex; $this->_compileRegex(); } diff --git a/library/HTMLPurifier/ChildDef/Empty.php b/library/HTMLPurifier/ChildDef/Empty.php index bba7182a..038ab8df 100644 --- a/library/HTMLPurifier/ChildDef/Empty.php +++ b/library/HTMLPurifier/ChildDef/Empty.php @@ -13,7 +13,7 @@ class HTMLPurifier_ChildDef_Empty extends HTMLPurifier_ChildDef { public $allow_empty = true; public $type = 'empty'; - public function HTMLPurifier_ChildDef_Empty() {} + public function __construct() {} public function validateChildren($tokens_of_children, $config, &$context) { return array(); } diff --git a/library/HTMLPurifier/ChildDef/Required.php b/library/HTMLPurifier/ChildDef/Required.php index 4de42961..b563dd67 100644 --- a/library/HTMLPurifier/ChildDef/Required.php +++ b/library/HTMLPurifier/ChildDef/Required.php @@ -15,7 +15,7 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef /** * @param $elements List of allowed element names (lowercase). */ - public function HTMLPurifier_ChildDef_Required($elements) { + public function __construct($elements) { if (is_string($elements)) { $elements = str_replace(' ', '', $elements); $elements = explode('|', $elements); diff --git a/library/HTMLPurifier/ChildDef/Table.php b/library/HTMLPurifier/ChildDef/Table.php index 5093a7be..21072e75 100644 --- a/library/HTMLPurifier/ChildDef/Table.php +++ b/library/HTMLPurifier/ChildDef/Table.php @@ -11,7 +11,7 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef public $type = 'table'; public $elements = array('tr' => true, 'tbody' => true, 'thead' => true, 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true); - public function HTMLPurifier_ChildDef_Table() {} + public function __construct() {} public function validateChildren($tokens_of_children, $config, &$context) { if (empty($tokens_of_children)) return false; diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php index 486ff034..4c44f2b2 100644 --- a/library/HTMLPurifier/Config.php +++ b/library/HTMLPurifier/Config.php @@ -91,7 +91,7 @@ class HTMLPurifier_Config * @param $definition HTMLPurifier_ConfigSchema that defines what directives * are allowed. */ - public function HTMLPurifier_Config(&$definition) { + public function __construct(&$definition) { $this->conf = $definition->defaults; // set up, copy in defaults $this->def = $definition; // keep a copy around for checking } diff --git a/library/HTMLPurifier/ConfigDef/Directive.php b/library/HTMLPurifier/ConfigDef/Directive.php index d207d9ab..8b176a85 100644 --- a/library/HTMLPurifier/ConfigDef/Directive.php +++ b/library/HTMLPurifier/ConfigDef/Directive.php @@ -11,7 +11,7 @@ class HTMLPurifier_ConfigDef_Directive extends HTMLPurifier_ConfigDef public $class = 'directive'; - public function HTMLPurifier_ConfigDef_Directive( + public function __construct( $type = null, $descriptions = null, $allow_null = null, diff --git a/library/HTMLPurifier/ConfigDef/DirectiveAlias.php b/library/HTMLPurifier/ConfigDef/DirectiveAlias.php index 6d18bbc3..db9be3e1 100644 --- a/library/HTMLPurifier/ConfigDef/DirectiveAlias.php +++ b/library/HTMLPurifier/ConfigDef/DirectiveAlias.php @@ -18,7 +18,7 @@ class HTMLPurifier_ConfigDef_DirectiveAlias extends HTMLPurifier_ConfigDef */ public $name; - public function HTMLPurifier_ConfigDef_DirectiveAlias($namespace, $name) { + public function __construct($namespace, $name) { $this->namespace = $namespace; $this->name = $name; } diff --git a/library/HTMLPurifier/ContentSets.php b/library/HTMLPurifier/ContentSets.php index e455eee0..d0b46e47 100644 --- a/library/HTMLPurifier/ContentSets.php +++ b/library/HTMLPurifier/ContentSets.php @@ -38,7 +38,7 @@ class HTMLPurifier_ContentSets * sets and populates the keys, values and lookup member variables. * @param $modules List of HTMLPurifier_HTMLModule */ - public function HTMLPurifier_ContentSets($modules) { + public function __construct($modules) { if (!is_array($modules)) $modules = array($modules); // populate content_sets based on module hints // sorry, no way of overloading diff --git a/library/HTMLPurifier/DefinitionCache.php b/library/HTMLPurifier/DefinitionCache.php index bd232cfc..88a5abb9 100644 --- a/library/HTMLPurifier/DefinitionCache.php +++ b/library/HTMLPurifier/DefinitionCache.php @@ -24,7 +24,7 @@ abstract class HTMLPurifier_DefinitionCache * @param $name Type of definition objects this instance of the * cache will handle. */ - public function HTMLPurifier_DefinitionCache($type) { + public function __construct($type) { $this->type = $type; } diff --git a/library/HTMLPurifier/DefinitionCache/Decorator.php b/library/HTMLPurifier/DefinitionCache/Decorator.php index 6d6de8b5..0470b4bd 100644 --- a/library/HTMLPurifier/DefinitionCache/Decorator.php +++ b/library/HTMLPurifier/DefinitionCache/Decorator.php @@ -10,7 +10,7 @@ class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCach */ public $cache; - public function HTMLPurifier_DefinitionCache_Decorator() {} + public function __construct() {} /** * Lazy decorator function diff --git a/library/HTMLPurifier/Doctype.php b/library/HTMLPurifier/Doctype.php index c6395731..673c6a3b 100644 --- a/library/HTMLPurifier/Doctype.php +++ b/library/HTMLPurifier/Doctype.php @@ -44,7 +44,7 @@ class HTMLPurifier_Doctype */ public $dtdSystem; - public function HTMLPurifier_Doctype($name = null, $xml = true, $modules = array(), + public function __construct($name = null, $xml = true, $modules = array(), $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null ) { $this->name = $name; diff --git a/library/HTMLPurifier/Encoder.php b/library/HTMLPurifier/Encoder.php index a1d178cf..af358932 100644 --- a/library/HTMLPurifier/Encoder.php +++ b/library/HTMLPurifier/Encoder.php @@ -58,7 +58,7 @@ class HTMLPurifier_Encoder /** * Constructor throws fatal error if you attempt to instantiate class */ - private function HTMLPurifier_Encoder() { + private function __construct() { trigger_error('Cannot instantiate encoder, call methods statically', E_USER_ERROR); } diff --git a/library/HTMLPurifier/ErrorCollector.php b/library/HTMLPurifier/ErrorCollector.php index fae62f96..ccce883c 100644 --- a/library/HTMLPurifier/ErrorCollector.php +++ b/library/HTMLPurifier/ErrorCollector.php @@ -14,7 +14,7 @@ class HTMLPurifier_ErrorCollector protected $generator; protected $context; - public function HTMLPurifier_ErrorCollector(&$context) { + public function __construct(&$context) { $this->locale =& $context->get('Locale'); $this->generator =& $context->get('Generator'); $this->context =& $context; diff --git a/library/HTMLPurifier/HTMLDefinition.php b/library/HTMLPurifier/HTMLDefinition.php index 2d6f8c0c..ed656f4a 100644 --- a/library/HTMLPurifier/HTMLDefinition.php +++ b/library/HTMLPurifier/HTMLDefinition.php @@ -273,7 +273,7 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition /** * Performs low-cost, preliminary initialization. */ - public function HTMLPurifier_HTMLDefinition() { + public function __construct() { $this->manager = new HTMLPurifier_HTMLModuleManager(); } diff --git a/library/HTMLPurifier/HTMLModule/Bdo.php b/library/HTMLPurifier/HTMLModule/Bdo.php index 33e5af7a..53d7d6cd 100644 --- a/library/HTMLPurifier/HTMLModule/Bdo.php +++ b/library/HTMLPurifier/HTMLModule/Bdo.php @@ -15,7 +15,7 @@ class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule 'I18N' => array('dir' => false) ); - public function HTMLPurifier_HTMLModule_Bdo() { + public function __construct() { $bdo =& $this->addElement( 'bdo', true, 'Inline', 'Inline', array('Core', 'Lang'), array( diff --git a/library/HTMLPurifier/HTMLModule/Edit.php b/library/HTMLPurifier/HTMLModule/Edit.php index 8899df3d..10c31b8a 100644 --- a/library/HTMLPurifier/HTMLModule/Edit.php +++ b/library/HTMLPurifier/HTMLModule/Edit.php @@ -12,7 +12,7 @@ class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule public $name = 'Edit'; - public function HTMLPurifier_HTMLModule_Edit() { + public function __construct() { $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow'; $attr = array( 'cite' => 'URI', diff --git a/library/HTMLPurifier/HTMLModule/Hypertext.php b/library/HTMLPurifier/HTMLModule/Hypertext.php index 3780f80b..e70cf6ac 100644 --- a/library/HTMLPurifier/HTMLModule/Hypertext.php +++ b/library/HTMLPurifier/HTMLModule/Hypertext.php @@ -11,7 +11,7 @@ class HTMLPurifier_HTMLModule_Hypertext extends HTMLPurifier_HTMLModule public $name = 'Hypertext'; - public function HTMLPurifier_HTMLModule_Hypertext() { + public function __construct() { $a =& $this->addElement( 'a', true, 'Inline', 'Inline', 'Common', array( diff --git a/library/HTMLPurifier/HTMLModule/Image.php b/library/HTMLPurifier/HTMLModule/Image.php index 41443a9a..50a243f0 100644 --- a/library/HTMLPurifier/HTMLModule/Image.php +++ b/library/HTMLPurifier/HTMLModule/Image.php @@ -15,7 +15,7 @@ class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule public $name = 'Image'; - public function HTMLPurifier_HTMLModule_Image() { + public function __construct() { $img =& $this->addElement( 'img', true, 'Inline', 'Empty', 'Common', array( diff --git a/library/HTMLPurifier/HTMLModule/Legacy.php b/library/HTMLPurifier/HTMLModule/Legacy.php index aafc6ef0..dfc7367a 100644 --- a/library/HTMLPurifier/HTMLModule/Legacy.php +++ b/library/HTMLPurifier/HTMLModule/Legacy.php @@ -23,7 +23,7 @@ class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule public $name = 'Legacy'; - public function HTMLPurifier_HTMLModule_Legacy() { + public function __construct() { $this->addElement('basefont', true, 'Inline', 'Empty', false, array( 'color' => 'Color', diff --git a/library/HTMLPurifier/HTMLModule/List.php b/library/HTMLPurifier/HTMLModule/List.php index 3e4d487e..a48ed510 100644 --- a/library/HTMLPurifier/HTMLModule/List.php +++ b/library/HTMLPurifier/HTMLModule/List.php @@ -21,7 +21,7 @@ class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule public $content_sets = array('Flow' => 'List'); - public function HTMLPurifier_HTMLModule_List() { + public function __construct() { $this->addElement('ol', true, 'List', 'Required: li', 'Common'); $this->addElement('ul', true, 'List', 'Required: li', 'Common'); $this->addElement('dl', true, 'List', 'Required: dt | dd', 'Common'); diff --git a/library/HTMLPurifier/HTMLModule/Object.php b/library/HTMLPurifier/HTMLModule/Object.php index 63ef3518..330d2373 100644 --- a/library/HTMLPurifier/HTMLModule/Object.php +++ b/library/HTMLPurifier/HTMLModule/Object.php @@ -12,7 +12,7 @@ class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule public $name = 'Object'; - public function HTMLPurifier_HTMLModule_Object() { + public function __construct() { $this->addElement('object', false, 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', array( diff --git a/library/HTMLPurifier/HTMLModule/Presentation.php b/library/HTMLPurifier/HTMLModule/Presentation.php index de54d114..7facf7ae 100644 --- a/library/HTMLPurifier/HTMLModule/Presentation.php +++ b/library/HTMLPurifier/HTMLModule/Presentation.php @@ -17,7 +17,7 @@ class HTMLPurifier_HTMLModule_Presentation extends HTMLPurifier_HTMLModule public $name = 'Presentation'; - public function HTMLPurifier_HTMLModule_Presentation() { + public function __construct() { $this->addElement('b', true, 'Inline', 'Inline', 'Common'); $this->addElement('big', true, 'Inline', 'Inline', 'Common'); $this->addElement('hr', true, 'Block', 'Empty', 'Common'); diff --git a/library/HTMLPurifier/HTMLModule/Ruby.php b/library/HTMLPurifier/HTMLModule/Ruby.php index 39d6e01c..33d135a8 100644 --- a/library/HTMLPurifier/HTMLModule/Ruby.php +++ b/library/HTMLPurifier/HTMLModule/Ruby.php @@ -11,7 +11,7 @@ class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule public $name = 'Ruby'; - public function HTMLPurifier_HTMLModule_Ruby() { + public function __construct() { $this->addElement('ruby', true, 'Inline', 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', 'Common'); diff --git a/library/HTMLPurifier/HTMLModule/Scripting.php b/library/HTMLPurifier/HTMLModule/Scripting.php index 23bfdf64..2e46d4db 100644 --- a/library/HTMLPurifier/HTMLModule/Scripting.php +++ b/library/HTMLPurifier/HTMLModule/Scripting.php @@ -32,7 +32,7 @@ class HTMLPurifier_HTMLModule_Scripting extends HTMLPurifier_HTMLModule public $elements = array('script', 'noscript'); public $content_sets = array('Block' => 'script | noscript', 'Inline' => 'script | noscript'); - public function HTMLPurifier_HTMLModule_Scripting() { + public function __construct() { // TODO: create custom child-definition for noscript that // auto-wraps stray #PCDATA in a similar manner to // blockquote's custom definition (we would use it but diff --git a/library/HTMLPurifier/HTMLModule/StyleAttribute.php b/library/HTMLPurifier/HTMLModule/StyleAttribute.php index 09a5e7ce..7336818d 100644 --- a/library/HTMLPurifier/HTMLModule/StyleAttribute.php +++ b/library/HTMLPurifier/HTMLModule/StyleAttribute.php @@ -18,7 +18,7 @@ class HTMLPurifier_HTMLModule_StyleAttribute extends HTMLPurifier_HTMLModule 'Core' => array(0 => array('Style')) ); - public function HTMLPurifier_HTMLModule_StyleAttribute() { + public function __construct() { $this->attr_collections['Style']['style'] = new HTMLPurifier_AttrDef_CSS(); } diff --git a/library/HTMLPurifier/HTMLModule/Tables.php b/library/HTMLPurifier/HTMLModule/Tables.php index 3e25b465..ee0e1623 100644 --- a/library/HTMLPurifier/HTMLModule/Tables.php +++ b/library/HTMLPurifier/HTMLModule/Tables.php @@ -11,7 +11,7 @@ class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule public $name = 'Tables'; - public function HTMLPurifier_HTMLModule_Tables() { + public function __construct() { $this->addElement('caption', true, false, 'Inline', 'Common'); diff --git a/library/HTMLPurifier/HTMLModule/Target.php b/library/HTMLPurifier/HTMLModule/Target.php index 5b77a872..e1792405 100644 --- a/library/HTMLPurifier/HTMLModule/Target.php +++ b/library/HTMLPurifier/HTMLModule/Target.php @@ -10,7 +10,7 @@ class HTMLPurifier_HTMLModule_Target extends HTMLPurifier_HTMLModule public $name = 'Target'; - public function HTMLPurifier_HTMLModule_Target() { + public function __construct() { $elements = array('a'); foreach ($elements as $name) { $e =& $this->addBlankElement($name); diff --git a/library/HTMLPurifier/HTMLModule/Text.php b/library/HTMLPurifier/HTMLModule/Text.php index 4b3945fe..a5ddc62f 100644 --- a/library/HTMLPurifier/HTMLModule/Text.php +++ b/library/HTMLPurifier/HTMLModule/Text.php @@ -22,7 +22,7 @@ class HTMLPurifier_HTMLModule_Text extends HTMLPurifier_HTMLModule 'Flow' => 'Heading | Block | Inline' ); - public function HTMLPurifier_HTMLModule_Text() { + public function __construct() { // Inline Phrasal ------------------------------------------------- $this->addElement('abbr', true, 'Inline', 'Inline', 'Common'); diff --git a/library/HTMLPurifier/HTMLModuleManager.php b/library/HTMLPurifier/HTMLModuleManager.php index 965a55f8..c03945d3 100644 --- a/library/HTMLPurifier/HTMLModuleManager.php +++ b/library/HTMLPurifier/HTMLModuleManager.php @@ -157,7 +157,7 @@ class HTMLPurifier_HTMLModuleManager /** If set to true, unsafe elements and attributes will be allowed */ public $trusted = false; - public function HTMLPurifier_HTMLModuleManager() { + public function __construct() { // editable internal objects $this->attrTypes = new HTMLPurifier_AttrTypes(); diff --git a/library/HTMLPurifier/Language.php b/library/HTMLPurifier/Language.php index dc0135e4..266699b4 100644 --- a/library/HTMLPurifier/Language.php +++ b/library/HTMLPurifier/Language.php @@ -36,7 +36,7 @@ class HTMLPurifier_Language */ protected $config, $context; - public function HTMLPurifier_Language($config, &$context) { + public function __construct($config, &$context) { $this->config = $config; $this->context =& $context; } diff --git a/library/HTMLPurifier/Lexer.php b/library/HTMLPurifier/Lexer.php index b86fe8df..8307a54f 100644 --- a/library/HTMLPurifier/Lexer.php +++ b/library/HTMLPurifier/Lexer.php @@ -201,7 +201,7 @@ class HTMLPurifier_Lexer // -- CONVENIENCE MEMBERS --------------------------------------------- - public function HTMLPurifier_Lexer() { + public function __construct() { $this->_entity_parser = new HTMLPurifier_EntityParser(); } diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php index 81a178a6..1726a55c 100644 --- a/library/HTMLPurifier/Lexer/DOMLex.php +++ b/library/HTMLPurifier/Lexer/DOMLex.php @@ -34,7 +34,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer public function __construct() { // setup the factory - parent::HTMLPurifier_Lexer(); + parent::__construct(); $this->factory = new HTMLPurifier_TokenFactory(); } diff --git a/library/HTMLPurifier/Printer.php b/library/HTMLPurifier/Printer.php index 5eae4fd8..c9e8841d 100644 --- a/library/HTMLPurifier/Printer.php +++ b/library/HTMLPurifier/Printer.php @@ -22,7 +22,7 @@ class HTMLPurifier_Printer /** * Initialize $generator. */ - public function HTMLPurifier_Printer() { + public function __construct() { $this->generator = new HTMLPurifier_Generator(); } diff --git a/library/HTMLPurifier/Printer/ConfigForm.php b/library/HTMLPurifier/Printer/ConfigForm.php index 5dab4ec3..a7ebd0a2 100644 --- a/library/HTMLPurifier/Printer/ConfigForm.php +++ b/library/HTMLPurifier/Printer/ConfigForm.php @@ -32,10 +32,10 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer * @param $doc_url String documentation URL, will have fragment tagged on * @param $compress Integer max length before compressing a directive name, set to false to turn off */ - public function HTMLPurifier_Printer_ConfigForm( + public function __construct( $name, $doc_url = null, $compress = false ) { - parent::HTMLPurifier_Printer(); + parent::__construct(); $this->docURL = $doc_url; $this->name = $name; $this->compress = $compress; diff --git a/library/HTMLPurifier/TagTransform/Simple.php b/library/HTMLPurifier/TagTransform/Simple.php index 4b1b2543..242752ec 100644 --- a/library/HTMLPurifier/TagTransform/Simple.php +++ b/library/HTMLPurifier/TagTransform/Simple.php @@ -16,7 +16,7 @@ class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform * @param $transform_to Tag name to transform to. * @param $style CSS style to add to the tag */ - public function HTMLPurifier_TagTransform_Simple($transform_to, $style = null) { + public function __construct($transform_to, $style = null) { $this->transform_to = $transform_to; $this->style = $style; } diff --git a/library/HTMLPurifier/Token.php b/library/HTMLPurifier/Token.php index 7dbf3436..27eb9c12 100644 --- a/library/HTMLPurifier/Token.php +++ b/library/HTMLPurifier/Token.php @@ -62,7 +62,7 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract * @param $name String name. * @param $attr Associative array of attributes. */ - public function HTMLPurifier_Token_Tag($name, $attr = array(), $line = null) { + public function __construct($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 @@ -131,7 +131,7 @@ class HTMLPurifier_Token_Text extends HTMLPurifier_Token * * @param $data String parsed character data. */ - public function HTMLPurifier_Token_Text($data, $line = null) { + public function __construct($data, $line = null) { $this->data = $data; $this->is_whitespace = ctype_space($data); $this->line = $line; @@ -151,7 +151,7 @@ class HTMLPurifier_Token_Comment extends HTMLPurifier_Token * * @param $data String comment data. */ - public function HTMLPurifier_Token_Comment($data, $line = null) { + public function __construct($data, $line = null) { $this->data = $data; $this->line = $line; } diff --git a/library/HTMLPurifier/TokenFactory.php b/library/HTMLPurifier/TokenFactory.php index d15ee1a9..ca3d8389 100644 --- a/library/HTMLPurifier/TokenFactory.php +++ b/library/HTMLPurifier/TokenFactory.php @@ -42,7 +42,7 @@ class HTMLPurifier_TokenFactory */ public function createStart($name, $attr = array()) { $p = clone $this->p_start; - $p->HTMLPurifier_Token_Tag($name, $attr); + $p->__construct($name, $attr); return $p; } @@ -53,7 +53,7 @@ class HTMLPurifier_TokenFactory */ public function createEnd($name) { $p = clone $this->p_end; - $p->HTMLPurifier_Token_Tag($name); + $p->__construct($name); return $p; } @@ -65,7 +65,7 @@ class HTMLPurifier_TokenFactory */ public function createEmpty($name, $attr = array()) { $p = clone $this->p_empty; - $p->HTMLPurifier_Token_Tag($name, $attr); + $p->__construct($name, $attr); return $p; } @@ -76,7 +76,7 @@ class HTMLPurifier_TokenFactory */ public function createText($data) { $p = clone $this->p_text; - $p->HTMLPurifier_Token_Text($data); + $p->__construct($data); return $p; } @@ -87,7 +87,7 @@ class HTMLPurifier_TokenFactory */ public function createComment($data) { $p = clone $this->p_comment; - $p->HTMLPurifier_Token_Comment($data); + $p->__construct($data); return $p; } diff --git a/library/HTMLPurifier/URI.php b/library/HTMLPurifier/URI.php index 2503589a..fef9ce33 100644 --- a/library/HTMLPurifier/URI.php +++ b/library/HTMLPurifier/URI.php @@ -14,7 +14,7 @@ class HTMLPurifier_URI /** * @note Automatically normalizes scheme and port */ - public function HTMLPurifier_URI($scheme, $userinfo, $host, $port, $path, $query, $fragment) { + public function __construct($scheme, $userinfo, $host, $port, $path, $query, $fragment) { $this->scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); $this->userinfo = $userinfo; $this->host = $host; diff --git a/library/HTMLPurifier/URIDefinition.php b/library/HTMLPurifier/URIDefinition.php index b20c3ba9..f9a7ddd8 100644 --- a/library/HTMLPurifier/URIDefinition.php +++ b/library/HTMLPurifier/URIDefinition.php @@ -91,7 +91,7 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition */ public $defaultScheme; - public function HTMLPurifier_URIDefinition() { + public function __construct() { $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); diff --git a/tests/HTMLPurifier/AttrCollectionsTest.php b/tests/HTMLPurifier/AttrCollectionsTest.php index 99f04c48..fb1bb758 100644 --- a/tests/HTMLPurifier/AttrCollectionsTest.php +++ b/tests/HTMLPurifier/AttrCollectionsTest.php @@ -44,7 +44,7 @@ class HTMLPurifier_AttrCollectionsTest extends HTMLPurifier_Harness 'Brocolli' => array() ); - $collections->HTMLPurifier_AttrCollections($types, $modules); + $collections->__construct($types, $modules); // this is without identifier expansion or inclusions $this->assertIdentical( $collections->info,