WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#15968 closed defect (bug) (invalid)

Shortcode parser includes quotes in attribute value

Reported by: tomaugerdotcom@… Owned by:
Milestone: Priority: normal
Severity: major Version: 3.0.3
Component: Shortcodes Keywords: shortcode, parsing, quotes
Focuses: 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@…4 years ago

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

yields the following:
$attribute == ""value"";

comment:2 tomaugerdotcom@…4 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));

comment:3 garyc404 years ago

Can't reproduce on current trunk. Could you try this on a default installation without any custom plugins or themes?

comment:4 nacin4 years ago

Sounds like maybe an unfiltered HTML issue?

comment:5 tomaugerdotcom@…4 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 markjaquith3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

comment:7 PeteMall3 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.