[wp-trac] [WordPress Trac] #40635: Move JavaScript `sanitizeText` and `stripTags` functions from press-this to core

WordPress Trac noreply at wordpress.org
Mon Oct 2 19:54:19 UTC 2017


#40635: Move JavaScript `sanitizeText` and `stripTags` functions from press-this to
core
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:
     Type:  enhancement                          |  adamsilverstein
 Priority:  normal                               |      Status:  reopened
Component:  Security                             |   Milestone:  4.9
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-unit-tests 2nd-      |  Resolution:
  opinion                                        |     Focuses:  javascript
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 Replying to [comment:7 ocean90]:
 > `wp.sanitize.sanitizeText()` looks weird since it's repetitive. What
 about `wp.sanitize.text()`?

 @ocean90 What do you think of something more descriptive here like
 `wp.sanitize.stripTagsAndEncode`?  This function strips tags from a string
 and also encodes any HTML entities.

 cc: @kraftbj if we change the function name, the `Press This` plugin will
 [https://plugins.trac.wordpress.org/browser/press-this/trunk/assets/press-
 this.js#L194 need an update].

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


More information about the wp-trac mailing list