[wp-trac] [WordPress Trac] #21613: format_to_edit runs esc_textarea if $richedit param is set to false, not true

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 17 15:28:55 UTC 2012


#21613: format_to_edit runs esc_textarea if $richedit param is set to false, not
true
--------------------------+------------------------------
 Reporter:  vhauri        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by vhauri):

 Replying to [comment:2 SergeyBiryukov]:
 > > Currently, the docs on format_to_edit() indicate that it runs the
 content through esc_textarea (which in turn runs htmlspecialchars() ) if
 the $richedit param is set to true.
 >
 > The docs actually say that `htmlspecialchars()` will be applied if
 `$richedit` is false: [[BR]]
 > http://core.trac.wordpress.org/browser/tags/3.4.1/wp-
 includes/formatting.php#L1256
 >
 > Current behaviour appears to be proper.

 Well, the code comment was recently updated to reflect the fact that the
 behavior is backwards( 'Whether the $content should not pass through
 htmlspecialchars().' has become 'Whether the $content should NOT pass
 through htmlspecialchars().'). I'm not sure the variable name $richedit
 makes sense anymore...perhaps $dont_encode = false would make more sense.
 Either way, having a variable that a) isn't really descriptive and b)
 written as a double negative is probably not ideal for clarity.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21613#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list