-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML API: Guard against non-string attribute values.
Because there are three ways for an attribute in HTML to exist, the HTML API reports three kinds of values for `get_attribute()` calls: - `null` means that no attribute exists of the given name - `true` means that the attribute exists but there is no value, e.g. '<input checked>'. - a string value means that the attribute exists and has a value, e.g. '<img src="test">'. When operating on the value returned by `get_attribute()` then it's important to ensure that it's a string value before treating it as one. A call to `empty()` is not enough because a boolean attribute, being `true`, does not return `false` for `empty()`. In this patch blocks that read and then use attribute values as strings have been updated in order to guard against cases where the attribute might not be the string the code expects.
- Loading branch information
Showing
7 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters