Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#56562 assigned defect (bug)

<br> Tag should be self closing on wp-mail.php file

Reported by: rajanpanchal2028's profile rajanpanchal2028 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Mail Keywords: has-patch close
Focuses: coding-standards Cc:

Description

Previously <br> tag is not self-closing so I have make <br> tag self-closing.

Attachments (1)

56562.patch (503 bytes) - added by rajanpanchal2028 2 years ago.
Patch added.

Download all attachments as: .zip

Change History (7)

@rajanpanchal2028
2 years ago

Patch added.

#1 @robinwpdeveloper
2 years ago

  • Keywords has-patch added; needs-patch removed

#2 @desrosj
2 years ago

  • Severity changed from major to normal

#3 @SergeyBiryukov
2 years ago

  • Keywords close added

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

I think the current code is correct, see the note for the 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>');
?>

#4 @costdev
2 years ago

@SergeyBiryukov is correct: https://3v4l.org/nvbKe

I agree with close.

#5 @rajanpanchal2028
2 years ago

@SergeyBiryukov,

If <br /> is not valid way to close <br> tag you can use <br/> tag as accordingly to WordPress coding standards <br/> is valid way to self-closing tag with strip_tags() function.

#6 @SergeyBiryukov
2 years ago

#56647 was marked as a duplicate.

Note: See TracTickets for help on using tickets.