Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#56430 closed defect (bug) (duplicate)

sanitize_text_field strips out valid characters

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

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
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to 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.