Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#37204 closed defect (bug) (invalid)

wp_strip_all_tags() function does not strip all tags

Reported by: aldemarcalazans Owned by:
Priority: normal Milestone:
Component: Security Version: 4.4.3
Severity: normal Keywords:
Cc: Focuses:

Description

If you apply the function wp_strip_all_tags() to the following strings, the result will be as follows:

<myname> ...................... ''              (OK)
<myname ....................... ''              (OK)
myname> ....................... myname>         (BAD)

As you can see, if only one "greater than" character is placed on the right of the word, the function does not work.

Change History (1)

#1 @dd32
10 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

I'd say this works as intended.

mytag> is not a valid HTML tag, and shouldn't be stripped, just as 5>4 shouldn't be stripped or modified.

wp_strip_all_tags() is designed to compliment PHP's strip_tags() functionality, but also strip the contents of <script> and <style> tags.

Note: See TracTickets for help on using tickets.