[wp-meta] [Making WordPress.org] #2879: Regex for @see linking of hooks does not account for unencoded quotes

Making WordPress.org noreply at wordpress.org
Thu Jun 15 22:10:24 UTC 2017


#2879: Regex for @see linking of hooks does not account for unencoded quotes
---------------------------+-----------------
 Reporter:  coffee2code    |      Owner:
     Type:  defect         |     Status:  new
 Priority:  normal         |  Milestone:
Component:  Developer Hub  |   Keywords:
---------------------------+-----------------
 When using the `@see` notation to link to hooks, it is necessary to place
 single quotes around the hook name. In the context of function
 descriptions (the majority usage), those quotes are already encoded as
 HTML entities prior to handling by `link_internal_element()`. However,
 data stored in meta (such as hash param descriptions) are not encoded.
 Thus, regular single quotes must also be considered in the auto-link
 handling for hooks (which presumes quotes are encoded).

 For example, `comment_form()`
 https://developer.wordpress.org/reference/functions/comment_form/:

 It's `$args` argument is a hash parameter. The first element 'fields'
 references a hook properly as `{@see 'comment_form_default_fields'}` and
 that string is eventually passed unencoded to `link_internal_element()`
 where, due to the lack of quote encoding, it passes through to the
 fallback option of assuming it should link to a function.

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2879>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list