Changeset 7368 for trunk/src/includes/common/formatting.php
- Timestamp:
- 11/17/2025 06:31:41 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/common/formatting.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/formatting.php
r7364 r7368 455 455 * Make mentions clickable in content areas 456 456 * 457 * Allows ' ', '>', '[', and '(' before as '@' username mention 458 * 457 459 * @since 2.6.0 bbPress (r6014) 458 460 * … … 463 465 */ 464 466 function bbp_make_mentions_clickable( $text = '' ) { 465 return preg_replace_callback( '#([\s>])@([0-9a-zA-Z-_]+)#i', 'bbp_make_mentions_clickable_callback', $text ); 467 return preg_replace_callback( 468 '#([\s>\[\(])\@([0-9a-zA-Z\-_]+)#i', 469 'bbp_make_mentions_clickable_callback', 470 $text 471 ); 466 472 } 467 473 … … 508 514 509 515 // Create the link to the user's profile 510 $html = '<a href="%1$s"' . $class . '>%2$s</a>'; 511 $url = bbp_get_user_profile_url( $user->ID ); 512 $anchor = sprintf( $html, esc_url( $url ), esc_html( $matches[0] ) ); 516 $html = '<a href="%1$s"%2$s>%3$s</a>'; 517 $url = bbp_get_user_profile_url( $user->ID ); 518 $mention = '@' . $matches[2]; 519 $anchor = sprintf( $html, esc_url( $url ), $class, esc_html( $mention ) ); 513 520 514 521 // Prevent this link from being followed by bots
Note: See TracChangeset
for help on using the changeset viewer.