From d6c4473a12b14df2b0cf147fa229b771e5453325 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sat, 21 Apr 2007 02:19:18 +0000 Subject: [PATCH] [1.6.1] Possibly fatal bug with __autoload() fixed in module manager git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@969 48356398-32a2-884e-a903-53898d9a118a --- NEWS | 1 + library/HTMLPurifier/HTMLModuleManager.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index fd2da597..7ebee219 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier ! DirectLex now preserves text in which a < bracket is followed by a non-alphanumeric character. This means that certain emoticons are now preserved. +- Possibly fatal bug with __autoload() fixed in module manager 1.6.0, released 2007-04-01 ! Support for most common deprecated attributes via transformations: diff --git a/library/HTMLPurifier/HTMLModuleManager.php b/library/HTMLPurifier/HTMLModuleManager.php index e0090472..250ddd12 100644 --- a/library/HTMLPurifier/HTMLModuleManager.php +++ b/library/HTMLPurifier/HTMLModuleManager.php @@ -206,17 +206,19 @@ class HTMLPurifier_HTMLModuleManager * @param $module Mixed: string module name, with or without * HTMLPurifier_HTMLModule prefix, or instance of * subclass of HTMLPurifier_HTMLModule. + * @note This function will not call autoload, you must instantiate + * (and thus invoke) autoload outside the method. */ function addModule($module) { if (is_string($module)) { $original_module = $module; - if (!class_exists($module)) { + if (!class_exists($module, false)) { foreach ($this->prefixes as $prefix) { $module = $prefix . $original_module; if (class_exists($module)) break; } } - if (!class_exists($module)) { + if (!class_exists($module, false)) { trigger_error($original_module . ' module does not exist', E_USER_ERROR); return;