Make WordPress Core


Ignore:
Timestamp:
02/15/2023 01:04:06 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve code comments in some sanitizing functions.

This aims to clarify a few inline comments related to removing percent-encoded characters and HTML entities.

Affected functions:

  • sanitize_user()
  • sanitize_title_with_dashes()
  • sanitize_html_class()
  • _sanitize_text_fields()
  • get_comments_number_text()

Follow-up to [465], [3454], [11433], [12503], [37987].

Props ace100, tanjimtc71, codemonksuvro, SergeyBiryukov.
Fixes #57712.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r55308 r55346  
    945945            if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) {
    946946                $text = preg_replace( '#<span class="screen-reader-text">.+?</span>#', '', $more );
    947                 $text = preg_replace( '/&.+?;/', '', $text ); // Kill entities.
     947                $text = preg_replace( '/&.+?;/', '', $text ); // Remove HTML entities.
    948948                $text = trim( strip_tags( $text ), '% ' );
    949949
Note: See TracChangeset for help on using the changeset viewer.