[wp-trac] [WordPress Trac] #47863: Fix odd, unexpected output from shortcode_parse_attts

WordPress Trac noreply at wordpress.org
Sun Aug 11 14:38:21 UTC 2019


#47863: Fix odd, unexpected output from shortcode_parse_attts
--------------------------+------------------------------
 Reporter:  mauteri       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Shortcodes    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> When passing a full shortcode to this function, I'm expecting only an
> array of key/value attributes of the shortcode to be returned, however
> this is not the case. Basic example (though my diff of unit tests have
> many), this shortcode:
>
> `[unittest title="unittest" link="https://unit.test/"]`
>
> will return an array that looks like this:
>

> (
>     0 => '[unittest'
>     'title' => 'unittest'
>     1 => 'link="https://unit.test/"]'
> )
>

> rather than one that looks like this
>

> (
>     'title' => 'unittest'
>     'link' => 'https://unit.test/'
> )
>

> I've already created a patch for this. I will put it in two parts. First
> unit tests with a data provider of 6 unit test format examples. 5 out of
> 6 will fail. I will then include another patch that includes the unit
> tests plus the proposed fix to the function.

New description:

 When passing a full shortcode to this function, I'm expecting only an
 array of key/value attributes of the shortcode to be returned, however
 this is not the case. Basic example (though my diff of unit tests have
 many), this shortcode:

 `[unittest title="unittest" link="https://unit.test/"]`

 will return an array that looks like this:

 {{{
 (
     0 => '[unittest'
     'title' => 'unittest'
     1 => 'link="https://unit.test/"]'
 )
 }}}

 rather than one that looks like this

 {{{
 (
     'title' => 'unittest'
     'link' => 'https://unit.test/'
 )
 }}}

 I've already created a patch for this. I will put it in two parts. First
 unit tests with a data provider of 6 unit test format examples. 5 out of 6
 will fail. I will then include another patch that includes the unit tests
 plus the proposed fix to the function.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47863#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list