[wp-trac] [WordPress Trac] #56562: <br> Tag should be self closing on wp-mail.php file

WordPress Trac noreply at wordpress.org
Tue Sep 13 14:46:28 UTC 2022


#56562: <br> Tag should be self closing on wp-mail.php file
------------------------------+-------------------------------
 Reporter:  rajanpanchal2028  |       Owner:  (none)
     Type:  defect (bug)      |      Status:  assigned
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Mail              |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch close   |     Focuses:  coding-standards
------------------------------+-------------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch => has-patch close


Comment:

 Hi there, welcome back to WordPress Trac! Thanks for the patch.

 I think the current code is correct, see the note for the
 [https://www.php.net/manual/en/function.strip-tags.php strip_tags()
 function] in the PHP Manual:
 > Self-closing XHTML tags are ignored and only non-self-closing tags
 should be used in `allowed_tags`. For example, to allow both `<br>` and
 `<br/>`, you should use:
 > {{{
 > <?php
 > strip_tags($input, '<br>');
 > ?>
 > }}}

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


More information about the wp-trac mailing list