Skip to content

Conversation

@miketsoft
Copy link

@miketsoft miketsoft commented Oct 3, 2025

@miketsoft miketsoft changed the title Normalize param's names of "safe" object fix: Normalize param's names of "safe" object Oct 3, 2025
// add other cases to support other param name/value pairs
default:
$attr['name'] = $attr['value'] = null;
$attr['name'] = $attr['value'] = '';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using null values instead of strings is deprecated in functions like htmlspecialchars

$new[] = new HTMLPurifier_Token_Empty('param', array('name' => $name, 'value' => $value));
$paramStack[strtolower($name)] = true;
}
$this->paramStack[] = $paramStack;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From line 67: we've already added these parameters, so we must initialize the parameters stack with them to avoid duplicates later.

// already been added
if (!isset($this->paramStack[$i][$n]) &&
isset($this->addParam[$n]) &&
$token->attr['name'] === $this->addParam[$n]) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that there is a bug: the condition $token->attr['name'] === $this->addParam[$n] always evaluates to false. This has been corrected to use $token->attr['value'] instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant