Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2015 12:12:52 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Replace all references to bp_get_root_domain() . '/' . bp_get_members_root_slug() with bp_get_members_directory_permalink(), ensuring all usages and filters are applied uniformly. See #4954.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-forums/bp-forums-filters.php

    r9383 r9467  
    168168 * Prevents embedded anchor tags.
    169169 *
    170  * @global object $bp Global BuddyPress settings object.
    171  *
    172170 * @param string $content Edited post content.
    173171 * @return string $content Sanitized post content.
    174172 */
    175173function bp_forums_strip_mentions_on_post_edit( $content ) {
    176     global $bp;
    177 
    178     $content = htmlspecialchars_decode( $content );
    179 
    180     $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>|";
    181 
    182     $content = preg_replace( $pattern, "$1", $content );
     174    $content   = htmlspecialchars_decode( $content );
     175    $directory = bp_get_members_directory_permalink();
     176    $pattern   = "|<a href=&#039;{$directory}[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
     177    $content   = preg_replace( $pattern, "$1", $content );
    183178
    184179    return $content;
    185180}
    186181add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' );
    187 add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
     182add_filter( 'bp_get_the_topic_text',           'bp_forums_strip_mentions_on_post_edit' );
    188183
    189184/** "Replied to" SQL filters *************************************************/
Note: See TracChangeset for help on using the changeset viewer.