Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#56430 closed defect (bug) (duplicate)

sanitize_text_field strips out valid characters

Reported by: vaakash Owned by:
Priority: normal Milestone:
Component: General Version: 6.0.1
Severity: normal Keywords:
Cc: Focuses:

Description

sanitize_text_field function strips out valid characters like for example %de from %description%

I cannot find other combinations of such but noticed this issue when a user reported for my plugin. Not sure if there are more.

Example:

<?php
echo sanitize_text_field( 'Hello %description% world' );
?>

Outputs

Hello scription% world

Change History (1)

#1 @SergeyBiryukov
4 years ago

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

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

This appears to be a manifestation of the issue previously reported in #31777, let's continue the discussion there.

Note: See TracTickets for help on using tickets.