From b63569ac2251acab86e2cee3b888ebce3e700380 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 31 Dec 2010 09:48:28 +0000 Subject: [PATCH] Fix bad interaction between bootstrap autoloader and Zend Debugger/APC. Signed-off-by: Edward Z. Yang --- NEWS | 4 +++- library/HTMLPurifier/Bootstrap.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 427aa132..ffc4961c 100644 --- a/NEWS +++ b/NEWS @@ -29,7 +29,9 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier are using standalone or the specialized includes files, you're expected to know what you're doing. - Stop repeatedly writing the cache file after I'm done customizing a - raw definition. + raw definition. Reported by ajh. +- Switch to using require_once in the Bootstrap to work around bad + interaction with Zend Debugger and APC. Reported by Antonio Parraga. 4.2.0, released 2010-09-15 ! Added %Core.RemoveProcessingInstructions, which lets you remove diff --git a/library/HTMLPurifier/Bootstrap.php b/library/HTMLPurifier/Bootstrap.php index 9a0354d6..607c5b18 100644 --- a/library/HTMLPurifier/Bootstrap.php +++ b/library/HTMLPurifier/Bootstrap.php @@ -37,7 +37,12 @@ class HTMLPurifier_Bootstrap public static function autoload($class) { $file = HTMLPurifier_Bootstrap::getPath($class); if (!$file) return false; - require HTMLPURIFIER_PREFIX . '/' . $file; + // Technically speaking, it should be ok and more efficient to + // just do 'require', but Antonio Parraga reports that with + // Zend extensions such as Zend debugger and APC, this invariant + // may be broken. Since we have efficient alternatives, pay + // the cost here and avoid the bug. + require_once HTMLPURIFIER_PREFIX . '/' . $file; return true; } -- 2.11.4.GIT