From ba2f25f605c56d00b462b32b67c44e7f51ff867a Mon Sep 17 00:00:00 2001 From: xemlock Date: Mon, 14 Aug 2017 15:05:31 +0200 Subject: [PATCH] Use full form of ternary operator (PHP 5.2 compat) --- library/HTMLPurifier/AttrDef/HTML/Bool2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/HTMLPurifier/AttrDef/HTML/Bool2.php b/library/HTMLPurifier/AttrDef/HTML/Bool2.php index d6241cb..b063a9c 100644 --- a/library/HTMLPurifier/AttrDef/HTML/Bool2.php +++ b/library/HTMLPurifier/AttrDef/HTML/Bool2.php @@ -19,7 +19,7 @@ class HTMLPurifier_AttrDef_HTML_Bool2 extends HTMLPurifier_AttrDef_HTML_Bool */ public function validate($string, $config, $context) { - $name = $this->name ? : $context->get('CurrentAttr'); + $name = strlen($this->name) ? $this->name : $context->get('CurrentAttr'); // boolean attribute validates if its value is either empty // or case-insensitively equal to attribute name return $string === '' || strcasecmp($name, $string) === 0;