Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#15968 closed defect (bug) (invalid)

Shortcode parser includes quotes in attribute value

Reported by: tomaugerdotcomyahooca's profile 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)

#1 @tomaugerdotcom@…
15 years ago

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

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

#2 @tomaugerdotcom@…
15 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));

#3 @garyc40
15 years ago

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

#4 @nacin
15 years ago

Sounds like maybe an unfiltered HTML issue?

#5 @tomaugerdotcom@…
15 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/)

#6 @markjaquith
15 years ago

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

#7 @PeteMall
15 years ago

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