From 1e2abb7f8f4f4df03a4f5508b1663762035ffcbc Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 27 Jun 2007 13:29:01 +0000 Subject: [PATCH] Fix little PHP 4.4.0 bug involving return by reference. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1252 48356398-32a2-884e-a903-53898d9a118a --- library/HTMLPurifier/Config.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php index d9b34c1e..644e6462 100644 --- a/library/HTMLPurifier/Config.php +++ b/library/HTMLPurifier/Config.php @@ -250,14 +250,16 @@ class HTMLPurifier_Config * called before it's been setup, otherwise won't work. */ function &getHTMLDefinition($raw = false) { - return $this->getDefinition('HTML', $raw); + $def =& $this->getDefinition('HTML', $raw); + return $def; // prevent PHP 4.4.0 from complaining } /** * Retrieves reference to the CSS definition */ function &getCSSDefinition($raw = false) { - return $this->getDefinition('CSS', $raw); + $def =& $this->getDefinition('CSS', $raw); + return $def; } /** @@ -306,7 +308,7 @@ class HTMLPurifier_Config if (is_null($this->get($type, 'DefinitionID'))) { // fatally error out if definition ID not set trigger_error("Cannot retrieve raw version without specifying %$type.DefinitionID", E_USER_ERROR); - $false = false; + $false = new HTMLPurifier_Error(); return $false; } return $this->definitions[$type];