Make WordPress Core

Opened 14 months ago

Last modified 14 months ago

#23517 new defect (bug)

Shortcode: if last parameter ends with '/', it is mistaken for self-closing shortcode closure

Reported by: sergem Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Shortcodes Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In example:

[shortcode urlparam=http://somesite/path/]content text[/shortcode]
"[shortcode urlparam=http://somesite/path/]" 

is interpreted as self closing:

[shortcode/] with urlparam="http://somesite/path"

All examples in http://codex.wordpress.org/Shortcode_API include whitespace before '/]'

This prevents implementation of bbcode parser for people to paste flickr photo snippets.

Attachments (1)

file.patch (814 bytes) - added by sergem 14 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 kovshenin14 months ago

Similar to HTML, the [shortcode/] syntax is a self-closing shortcode, and there's no easy way to distinguish that from the argument value, unless you enclose that in quotes, which should work:

[shortcode urlparam="http://somesite/path/"]

Suggesting to close as invalid.

comment:2 sergem14 months ago

  • Keywords has-patch added

comment:3 sergem14 months ago

lookbehind non-whitespace does it nicely!

comment:4 SergeyBiryukov14 months ago

  • Description modified (diff)

comment:5 SergeyBiryukov14 months ago

Please provide an svn diff if possible, rather than a standard diff.

sergem14 months ago


Note: See TracTickets for help on using tickets.