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
- Cc shidouhikari added
- Priority changed from normal to high
- Severity changed from normal to major
- Priority changed from high to normal
- Severity changed from major to normal
- Keywords needs-unit-tests added; early removed
- Milestone changed from 3.0 to Future Release
- Resolution set to fixed
- Status changed from accepted to closed