Skip to content

Commit

Permalink
Use full form of ternary operator (PHP 5.2 compat)
Browse files Browse the repository at this point in the history
  • Loading branch information
xemlock committed Aug 14, 2017
1 parent 2317e94 commit ba2f25f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/HTMLPurifier/AttrDef/HTML/Bool2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba2f25f

Please sign in to comment.