From ec6b6821cfbbca1e28a868cb4541a9d8f9b6af7d Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 16 May 2008 01:25:22 +0000 Subject: [PATCH] [2.1.4] Add information about PHP 5.0.5 or earlier. - Fix segfault in 5.0.x with IDAccumulator test. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/php4@1726 48356398-32a2-884e-a903-53898d9a118a --- INSTALL | 9 +++++---- library/HTMLPurifier/IDAccumulator.php | 6 +++--- tests/HTMLPurifier/IDAccumulatorTest.php | 5 ++++- tests/multitest.php | 11 +---------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/INSTALL b/INSTALL index 317c89bb..b7062bec 100644 --- a/INSTALL +++ b/INSTALL @@ -14,10 +14,11 @@ basic sanity checks to get the most out of this library. --------------------------------------------------------------------------- 1. Compatibility -HTML Purifier works in both PHP 4 and PHP 5, and is actively tested from -PHP 4.3.7 and up (see tests/multitest.php for specific versions). It has -no core dependencies with other libraries. PHP 4 support will be -deprecated on December 31, 2007, at which time only essential security +THIS IS A DEPRECATED PHP4 VERSION OF HTML PURIFIER. + +If you are running PHP5, please go to http://htmlpurifier.org to download +the latest version. This version of HTML Purifier is only actively tested +from PHP 4.3.7 to PHP 5.0.5. Essential security will be released for this branch fixes will be issued for the PHP 4 version until August 8, 2008. These optional extensions can enhance the capabilities of HTML Purifier: diff --git a/library/HTMLPurifier/IDAccumulator.php b/library/HTMLPurifier/IDAccumulator.php index 60715afc..e746e565 100644 --- a/library/HTMLPurifier/IDAccumulator.php +++ b/library/HTMLPurifier/IDAccumulator.php @@ -28,9 +28,9 @@ class HTMLPurifier_IDAccumulator * @static */ function build($config, &$context) { - $id_accumulator = new HTMLPurifier_IDAccumulator(); - $id_accumulator->load($config->get('Attr', 'IDBlacklist')); - return $id_accumulator; + $acc = new HTMLPurifier_IDAccumulator(); + $acc->load($config->get('Attr', 'IDBlacklist')); + return $acc; } /** diff --git a/tests/HTMLPurifier/IDAccumulatorTest.php b/tests/HTMLPurifier/IDAccumulatorTest.php index c6249eca..5fd8237a 100644 --- a/tests/HTMLPurifier/IDAccumulatorTest.php +++ b/tests/HTMLPurifier/IDAccumulatorTest.php @@ -32,7 +32,10 @@ class HTMLPurifier_IDAccumulatorTest extends HTMLPurifier_Harness function testBuild() { $this->config->set('Attr', 'IDBlacklist', array('foo')); - $accumulator = HTMLPurifier_IDAccumulator::build($this->config, $this->context); + // For some reason, doing the static call here results in a segfault + // for early versions of PHP 5.0.x + $acc = new HTMLPurifier_IDAccumulator(); + $accumulator = $acc->build($this->config, $this->context); $this->assertTrue( isset($accumulator->ids['foo']) ); } diff --git a/tests/multitest.php b/tests/multitest.php index 88031207..8a734b1e 100644 --- a/tests/multitest.php +++ b/tests/multitest.php @@ -12,16 +12,7 @@ $versions_to_test = array( '4.4.7', '5.0.4', '5.0.5', - '5.1.4', - '5.1.6', - '5.2.0', - '5.2.1', - '5.2.2', - '5.2.3', - '5.2.4', - '5.2.5RC2-dev', - '5.3.0-dev', - // '6.0.0-dev', + // We don't care about later versions: use HTML Purifier 3+!!! ); echo str_repeat('-', 70) . "\n";