From d6fbd7df22e7bd7904d2b9cb94539cd8aa0fda7a Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 16 Oct 2013 18:55:23 -0700 Subject: [PATCH] Remove some unnecessary pass-by-reference. Signed-off-by: Edward Z. Yang --- library/HTMLPurifier/AttrValidator.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/library/HTMLPurifier/AttrValidator.php b/library/HTMLPurifier/AttrValidator.php index 18311bc3..f97dc93e 100644 --- a/library/HTMLPurifier/AttrValidator.php +++ b/library/HTMLPurifier/AttrValidator.php @@ -9,17 +9,13 @@ class HTMLPurifier_AttrValidator { /** - * Validates the attributes of a token, returning a modified token + * Validates the attributes of a token, mutating it as necessary. * that has valid tokens - * @param HTMLPurifier_Token $token Reference to token to validate. We require a reference - * because the operation this class performs on the token are - * not atomic, so the context CurrentToken to be updated - * throughout + * @param HTMLPurifier_Token $token Token to validate. * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config * @param HTMLPurifier_Context $context Instance of HTMLPurifier_Context - * @return HTMLPurifier_Token */ - public function validateToken(&$token, &$config, $context) + public function validateToken($token, $config, $context) { $definition = $config->getHTMLDefinition(); $e =& $context->get('ErrorCollector', true); @@ -40,7 +36,7 @@ class HTMLPurifier_AttrValidator if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty ) { - return $token; + return; } // create alias to global definition array, see also $defs -- 2.11.4.GIT