From e2c15f1c9849638fb64a3c822234d20607c6f0a5 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 26 Aug 2010 21:40:58 -0700 Subject: [PATCH] Fix Mac Snow Leopard APC bug. Signed-off-by: Edward Z. Yang --- NEWS | 2 ++ library/HTMLPurifier/Generator.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6a7e2a33..177712fd 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier did nothing. Thanks David Rothstein for reporting. - Fix improper handling of Internet Explorer conditional comments by parser. Thanks zmonteca for reporting. +- Fix missing attributes bug when running on Mac Snow Leopard and APC. + Thanks sidepodcast for the fix. 4.1.1, released 2010-05-31 - Fix undefined index warnings in maintenance scripts. diff --git a/library/HTMLPurifier/Generator.php b/library/HTMLPurifier/Generator.php index 4a624172..f5310361 100644 --- a/library/HTMLPurifier/Generator.php +++ b/library/HTMLPurifier/Generator.php @@ -215,7 +215,10 @@ class HTMLPurifier_Generator * permissible for non-attribute output. * @return String escaped data. */ - public function escape($string, $quote = ENT_COMPAT) { + public function escape($string, $quote = null) { + // Workaround for APC bug on Mac Leopard reported by sidepodcast + // http://htmlpurifier.org/phorum/read.php?3,4823,4846 + if ($quote === null) $quote = ENT_COMPAT; return htmlspecialchars($string, $quote, 'UTF-8'); } -- 2.11.4.GIT