[wp-trac] [WordPress Trac] #24106: Simplify wp_slash()

WordPress Trac noreply at wordpress.org
Tue Apr 16 19:37:12 UTC 2013


#24106: Simplify wp_slash()
-----------------------------+-------------------------
 Reporter:  TobiasBg         |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Formatting
  Version:                   |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+-------------------------
 [23416] added the function {{{wp_slash()}}} for the slashing sanitization
 in #21767.

 [https://irclogs.wordpress.org/chanlog.php?channel=wordpress-
 dev&day=2013-04-16&sort=asc#m595515 According to ryan], it has been
 modelled after {{{$wpdb->prepare()}}}, and therefore uses a custom
 {{{foreach}}} loop with an {{{if}}}-check in it.
 I suggest to instead model it after {{{stripslashes_deep()}}} and
 {{{urlencode_deep()}}} to simplify the function and make it better
 readable.

 The attached patch also makes it clearer that this function works in a
 recursive manner.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24106>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list