[wp-trac] [WordPress Trac] #55852: Reverse wrapping of `sanitize_url()` and `esc_url_raw()`.

WordPress Trac noreply at wordpress.org
Tue May 31 11:21:33 UTC 2022


#55852: Reverse wrapping of `sanitize_url()` and `esc_url_raw()`.
--------------------------------------+---------------------
 Reporter:  peterwilsoncc             |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  6.1
Component:  Formatting                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:2 benjgrolleau]:
 > I have reversed the two wrappers, and change comments relatives to the
 functions too.

 Hi there, thanks for the patch! It looks good to me, I only have two minor
 suggestions:

 * The new `@return` tag for `esc_url_raw()` says:
 {{{
 @return string The cleaned URL after sanitize_url() is run with the 'db'
 context.
 }}}
  `sanitize_url()` does not have a `db` context, so I think we can either
 omit that part or leave the original tag as is. Given that the function
 description also mentions `esc_url()` and not `sanitize_url()`, I think
 keeping the original tag would be preferable.
 * `sanitize_url()` has this comment in the description:
 {{{
 This function is an alias for esc_url_raw().
 }}}
  It should be moved to `esc_url_raw()` and changed to:
 {{{
 This function is an alias for sanitize_url().
 }}}

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


More information about the wp-trac mailing list