[wp-trac] [WordPress Trac] #42195: wp_slash() is lossy

WordPress Trac noreply at wordpress.org
Sat Jul 11 00:12:14 UTC 2020


#42195: wp_slash() is lossy
-------------------------------------------------+-------------------------
 Reporter:  johnbillion                          |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.5
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  dev-feedback has-unit-tests has-     |     Focuses:
  patch needs-testing                            |
-------------------------------------------------+-------------------------
Changes (by whyisjake):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"48433" 48433]:
 {{{
 #!CommitTicketReference repository="" revision="48433"
 Formatting: Prevent wp_slash from returning non-strings as strings.

 If a bool/float/int is passed into wp_slash it will be coerced into a
 string.

 This changes the behavior to only slash strings. At the same time, handles
 recursion a little nicer by calling array_map for arrays.

 Fixes #42195, #24106.

 Props johnbillion, andizer, jrf, ryotasakamoto, SergeyBiryukov, donmhico,
 TobiasBg, markoheijnen, ryan, nacin, devesine, whyisjake.
 }}}

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


More information about the wp-trac mailing list