Self closing shortcodes
|Reported by:||rb-cohen||Owned by:||westi|
First bug report, be gentle.
I've noticed that the shortcode regex doesn't take note of the self closing "/" properly, and continues to search for a closing tag within the content passed to it.
I think it should stop looking for a closing tag if the tag is self closing. See the following example:
[test id="1"/] first self closed, now [test id="2"]with content[/test]
This gets sent to the shortcode callback function as:
Content: first self closed, now [test id="2"]with content
I've posted some further tests at http://blograndom.com/tests/shortcode/ , to prove the bug exists and my proposed fix (see attached diff file). The fix also offers slight speed enhancements for self closing divs because it stops looking.
It looks like the trunk version of shortcodes.php is slightly different to 2.7.1, but I've applied the patch from the trunk version which still seems to have the same problem.
Change History (37)
- Cc westi added
- Keywords needs-unit-tests added; shortcode removed
comment:29 shidouhikari — 4 years ago
- Cc shidouhikari added
- Priority changed from normal to high
- Severity changed from normal to major
comment:30 rmccue — 4 years ago
- Priority changed from high to normal
- Severity changed from major to normal
comment:31 nacin — 4 years ago
- Keywords needs-unit-tests added; early removed
- Milestone changed from 3.0 to Future Release
comment:35 Viper007Bond — 17 months ago
- Resolution set to fixed
- Status changed from accepted to closed