[wp-trac] [WordPress Trac] #34939: Shortcode regex no longer matches [shortcode=XXX]
WordPress Trac
noreply at wordpress.org
Tue Dec 22 02:34:36 UTC 2015
#34939: Shortcode regex no longer matches [shortcode=XXX]
-------------------------------------+--------------------------
Reporter: kraftbj | Owner: miqrogroove
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.4.1
Component: Shortcodes | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+--------------------------
Comment (by dd32):
Replying to [comment:24 aaroncampbell]:
> Replying to [comment:23 dd32]:
> > Replying to [comment:21 aaroncampbell]:
> > > It also trims '=' from the left side of the attributes string, so
that the resulting attribute from `[shortcode=http://wordpress.org]` is
just 'http://wordpress.org'.
> >
> > I'm not sure we can, or should, make that change here unfortunately.
Existing shortcodes are probably relying upon it to work like that, I'd
rather just leave that as an undocumented format
>
> I think that `$attributes[0]` used to just be the url, but without the
left trim before parsing them we end up with `=https://wordpress.org`
instead. The trim will only affect the pre-parsed attribute string if the
character immediately following the shortcode name is an equal sign. I'm
pretty sure that's a safe move and also keeps parity with the way things
used to work.
That's not the case. It's always been passed as `=attr`. (At least
according to /tags/4.2 &
[https://github.com/Automattic/jetpack/blob/master/modules/shortcodes/youtube.php#L328
Jetpacks source])
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34939#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list