[wp-trac] [WordPress Trac] #43946: Inconsistent encoding of comment_content

WordPress Trac noreply at wordpress.org
Fri May 4 05:17:08 UTC 2018


#43946: Inconsistent encoding of comment_content
--------------------------+------------------------------
 Reporter:  leewillis77   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  4.9.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by subrataemfluence):

 So, basically what you mean is "NOT" to escape while storing and rather
 keep it raw. Escape the value the way it is required when outputted.
 Meaning you want it to be other way round. Am I right?

 Replying to [comment:4 leewillis77]:
 > Thanks for the reproduction, and the proposed patch. However, I'm not
 sure that patch really addresses the issue. In general, best practice is
 to store content "raw" and escape it as appropriate on usage (bearing in
 mind that different output schemes will have different encoding needs,
 e.g. XML vs HTML vs JSON, so ideally any such patch should do that
 (ensuring that it *is* properly escaped on usage).
 >
 > I also think any patch needs to deal somehow with legacy data.

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


More information about the wp-trac mailing list