#2696 closed defect (bug) (fixed)
Make profile links nofollow
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | ||
Component: | Extended Profile | Keywords: | dev-feedback |
Cc: |
Description
As a spam prevention measure. If they're nofollow, there'll be less incentive to spam.
Posting this as a patch before committing so I can get feedback.
Attachments (1)
Change History (8)
#3
@
14 years ago
Paul (or anyone else) - Do you think there's a good reason why this filter should only be applied on the way out? Is there any efficiency to be gained by adding nofollow on the way in and then just double checking on the way out (so as to catch cases where URLs are turned automatically into links, etc)? I ask because it looks like the BP filters are basically copies of the WP core filters, except that they don't do the escaping that you'd expect when an item is getting written to the database. So for some reason whoever wrote these filters (Andy?) turned it into an output-only filter. Does that still make sense, or should we do it the WP way?
#4
@
14 years ago
I'd try to use WP functions whenever possible. No need trying to reinvent the wheel.
add_filter( 'bp_get_the_profile_field_value', 'wp_rel_nofollow' );
#5
@
14 years ago
For comments, WordPress only does wp_rel_nofollow on the way in, so I suggest we do the same.
#7
@
14 years ago
Because some profile data ends up being an array, a simple filter wouldn't work. I had to add the wp_rel_nofollow() calls inside of xprofile_sanitize_data_value_before_save(), which detects for arrays. In order to prevent kses from stripping the rel attributes on the way out, I also had to add a xprofile_filter_kses() wrapper for wp_kses().
Paul points out that WP has core functions for this. wp_rel_nofollow() and wp_rel_nofollow_callback(). Maybe this patch (and the corresponding activity and forums filters) should be rewritten to use the core functions.