[wp-trac] [WordPress Trac] #49277: Implement email sanitize in REST API

WordPress Trac noreply at wordpress.org
Thu Jan 23 16:04:18 UTC 2020


#49277: Implement email sanitize in REST API
-----------------------------------+------------------------------
 Reporter:  spacedmonkey           |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  REST API               |     Version:  4.4
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by spacedmonkey):

 `filter_var` is used
 [https://github.com/WordPress/WordPress/blob/b7634470193acd081d8de0b43ddf279c1158c378
 /wp-includes/class-phpmailer.php#L1157 elsewhere] in core.

 `sanitize_text_field` is applied to emails first then `filter_var` is run.
 The idea is to just remove character that are not valid in an email. It
 doesn't do a lot of validation that `is_email`, checking domain length
 etc.

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


More information about the wp-trac mailing list