Skip to:
Content

BuddyPress.org

Changeset 3340


Ignore:
Timestamp:
11/02/2010 08:57:15 PM (14 years ago)
Author:
djpaul
Message:

Change the "at name" filter to only replace whole-word matches. See #2145

File:
1 edited

Legend:

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

    r3269 r3340  
    121121        update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
    122122
    123         $content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
     123        $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
    124124    }
    125125
Note: See TracChangeset for help on using the changeset viewer.