[wp-trac] [WordPress Trac] #28699: \0 (backslash+zero) gets stripped from post content for users without "unfiltered_html"

WordPress Trac noreply at wordpress.org
Fri Jun 19 07:07:20 UTC 2015

#28699: \0 (backslash+zero) gets stripped from post content for users without
 Reporter:  azaozz          |       Owner:  miqrogroove
     Type:  defect (bug)    |      Status:  accepted
 Priority:  normal          |   Milestone:  4.3
Component:  Formatting      |     Version:  1.0
 Severity:  normal          |  Resolution:
 Keywords:  kses has-patch  |     Focuses:

Comment (by mdawaffe):

 Yeah - you found the alternatives.  I like attachment:miqro-28699.5.patch​
 - when reading a call to the function, it's clear what the parameter does.
 Any of the following would pass the "no boolean trap" test.

 wp_kses_no_null( $string, 'keep_slash_zero' ); // Not very WordPressy
 wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) ); //
 wp_kses_no_null( $string, array( 'keep_slash_zero' => true ) ); // Seems
 most WordPressy to me

 Either of the last two seem fine to me.  Stylistically, I may have a
 slight preference for attachment:miqro-28699.5.patch, since it allows for
 the current "keep", "remove", and a possible future "urlencode", etc.
 (We'll never need/want such an option; I'm just talking about style
 habits, not the code.)

Ticket URL: <https://core.trac.wordpress.org/ticket/28699#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list