-
Notifications
You must be signed in to change notification settings - Fork 350
fix: Normalize param's names of "safe" object #458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Normalize param's names for "safe" object
| // add other cases to support other param name/value pairs | ||
| default: | ||
| $attr['name'] = $attr['value'] = null; | ||
| $attr['name'] = $attr['value'] = ''; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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]) { |
There was a problem hiding this comment.
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.
#459