Skip to:
Content

BuddyPress.org

Changeset 4118


Ignore:
Timestamp:
03/11/2011 09:00:05 PM (14 years ago)
Author:
boonebgorges
Message:

Modifies @-mention regex to better handle @ signs in usernames. Fixes #2057. Props boonebgorges and SergeyBiryukov

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-functions.php

    r3985 r4118  
    2020 */
    2121function bp_activity_find_mentions( $content ) {
    22     $pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
     22    $pattern = '/[@]+([A-Za-z0-9-_\.@]+)/';
    2323    preg_match_all( $pattern, $content, $usernames );
    2424
  • trunk/bp-activity/bp-activity-notifications.php

    r3917 r4118  
    1313
    1414    /* Scan for @username strings in an activity update. Notify each user. */
    15     $pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
     15    $pattern = '/[@]+([A-Za-z0-9-_\.@]+)/';
    1616    preg_match_all( $pattern, $content, $usernames );
    1717
  • trunk/bp-forums/bp-forums-filters.php

    r4088 r4118  
    124124    $content = htmlspecialchars_decode( $content );
    125125
    126     $pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.]+)</a>|";
     126    $pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
    127127
    128128    $content = preg_replace( $pattern, "$1", $content );
  • trunk/bp-groups/bp-groups-notifications.php

    r3917 r4118  
    254254
    255255    /* Scan for @username strings in an activity update. Notify each user. */
    256     $pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
     256    $pattern = '/[@]+([A-Za-z0-9-_\.@]+)/';
    257257    preg_match_all( $pattern, $content, $usernames );
    258258
Note: See TracChangeset for help on using the changeset viewer.