mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55346 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -944,7 +944,7 @@ function get_comments_number_text( $zero = false, $one = false, $more = false, $
|
||||
*/
|
||||
if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) {
|
||||
$text = preg_replace( '#<span class="screen-reader-text">.+?</span>#', '', $more );
|
||||
$text = preg_replace( '/&.+?;/', '', $text ); // Kill entities.
|
||||
$text = preg_replace( '/&.+?;/', '', $text ); // Remove HTML entities.
|
||||
$text = trim( strip_tags( $text ), '% ' );
|
||||
|
||||
// Replace '% Comments' with a proper plural form.
|
||||
|
||||
Reference in New Issue
Block a user