Changeset 7335
- Timestamp:
- 07/02/2025 02:52:12 PM (5 months ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
-
common/formatting.php (modified) (1 diff)
-
core/filters.php (modified) (1 diff)
-
replies/template.php (modified) (1 diff)
-
topics/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/formatting.php
r7160 r7335 783 783 return $reason; 784 784 } 785 786 /** Users *********************************************************************/ 787 788 /** 789 * Format the display name of a user. 790 * 791 * Abstracts mbstring library check and fallback to utf8_encode(). 792 * 793 * @link https://bbpress.trac.wordpress.org/ticket/2141 794 * 795 * @since 2.6.14 796 * 797 * @param string $display_name The author display 798 * @return string 799 */ 800 function bbp_format_user_display_name( $display_name = '' ) { 801 802 // Default return value 803 $retval = $display_name; 804 805 // Use the mbstring library if possible 806 if ( function_exists( 'mb_check_encoding' ) && ! mb_check_encoding( $display_name, 'UTF-8' ) ) { 807 $retval = mb_convert_encoding( $display_name, 'UTF-8', 'ISO-8859-1' ); 808 809 // Fallback to function that (deprecated in PHP8.2) 810 } elseif ( seems_utf8( $display_name ) === false ) { 811 $retval = utf8_encode( $display_name ); 812 } 813 814 // Return 815 return $retval; 816 } -
trunk/src/includes/core/filters.php
r7276 r7335 310 310 311 311 // Topic and reply author display names 312 add_filter( 'bbp_get_topic_author_display_name', 'wptexturize' ); 313 add_filter( 'bbp_get_topic_author_display_name', 'convert_chars' ); 314 add_filter( 'bbp_get_topic_author_display_name', 'esc_html' ); 315 add_filter( 'bbp_get_reply_author_display_name', 'wptexturize' ); 316 add_filter( 'bbp_get_reply_author_display_name', 'convert_chars' ); 317 add_filter( 'bbp_get_reply_author_display_name', 'esc_html' ); 312 add_filter( 'bbp_get_topic_author_display_name', 'bbp_format_user_display_name' ); 313 add_filter( 'bbp_get_topic_author_display_name', 'wptexturize' ); 314 add_filter( 'bbp_get_topic_author_display_name', 'convert_chars' ); 315 add_filter( 'bbp_get_topic_author_display_name', 'esc_html' ); 316 add_filter( 'bbp_get_reply_author_display_name', 'bbp_format_user_display_name' ); 317 add_filter( 'bbp_get_reply_author_display_name', 'wptexturize' ); 318 add_filter( 'bbp_get_reply_author_display_name', 'convert_chars' ); 319 add_filter( 'bbp_get_reply_author_display_name', 'esc_html' ); 318 320 319 321 /** -
trunk/src/includes/replies/template.php
r7322 r7335 1100 1100 } 1101 1101 1102 // Encode possible UTF8 display names1103 if ( seems_utf8( $author_name ) === false ) {1104 $author_name = utf8_encode( $author_name );1105 }1106 1107 1102 // Filter & return 1108 1103 return apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id ); -
trunk/src/includes/topics/template.php
r7279 r7335 1336 1336 } 1337 1337 1338 // Encode possible UTF8 display names1339 if ( seems_utf8( $author_name ) === false ) {1340 $author_name = utf8_encode( $author_name );1341 }1342 1343 1338 // Filter & return 1344 1339 return apply_filters( 'bbp_get_topic_author_display_name', $author_name, $topic_id );
Note: See TracChangeset
for help on using the changeset viewer.