#15968 closed defect (bug) (invalid)
Shortcode parser includes quotes in attribute value
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Shortcodes | Version: | 3.0.3 |
| Severity: | major | Keywords: | shortcode, parsing, quotes |
| Cc: |
Description
This appears to be new since 3.0.3. Any shortcodes using the following format:
[shortcode attribute="value"]
when $value is extracted, it now includes the quotes. IE: $value == ""value""; (as opposed to $value == "value").
As a result, any plugins that switch or parse $value without first stripping the quotes will now fail. This could potentially affect a lot of implementations. I can't imagine this is desired functionality.
Change History (7)
comment:1
tomaugerdotcom@… — 2 years ago
comment:2
tomaugerdotcom@… — 2 years ago
Can be fixed by changing line 229 of shortcodes.php to this:
$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", htmlspecialchars_decode($text));
Can't reproduce on current trunk. Could you try this on a default installation without any custom plugins or themes?
comment:5
tomaugerdotcom@… — 2 years ago
Yes, that must be it. I apologize for not trying this on a vanilla install before submitting. I'm new.
For future reference, theme:arras (http://www.arrastheme.com/)
comment:6
markjaquith — 2 years ago
- Resolution set to invalid
- Status changed from new to closed

After further inspection the following shortcode:
[shortcode attribute="value"]
yields the following:
$attribute == ""value"";