Changeset 9467 for trunk/src/bp-forums/bp-forums-filters.php
- Timestamp:
- 02/10/2015 12:12:52 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-filters.php
r9383 r9467 168 168 * Prevents embedded anchor tags. 169 169 * 170 * @global object $bp Global BuddyPress settings object.171 *172 170 * @param string $content Edited post content. 173 171 * @return string $content Sanitized post content. 174 172 */ 175 173 function bp_forums_strip_mentions_on_post_edit( $content ) { 176 global $bp; 177 178 $content = htmlspecialchars_decode( $content ); 179 180 $pattern = "|<a href='" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/' rel='nofollow'>(@[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='{$directory}[A-Za-z0-9-_\.]+/' rel='nofollow'>(@[A-Za-z0-9-_\.@]+)</a>|"; 177 $content = preg_replace( $pattern, "$1", $content ); 183 178 184 179 return $content; 185 180 } 186 181 add_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' );182 add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' ); 188 183 189 184 /** "Replied to" SQL filters *************************************************/
Note: See TracChangeset
for help on using the changeset viewer.