Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2696 closed defect (bug) (fixed)

Make profile links nofollow

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Extended Profile Keywords: dev-feedback


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)

2696-1.diff (1.1 KB) - added by boonebgorges 14 years ago.

Download all attachments as: .zip

Change History (8)

14 years ago

#1 @boonebgorges
14 years ago

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.

#3 @boonebgorges
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 @r-a-y
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 @DJPaul
14 years ago

For comments, WordPress only does wp_rel_nofollow on the way in, so I suggest we do the same.

#6 @boonebgorges
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3560]) Adds rel=nofollow to xprofile data links. Fixes #2696. Fixes a handful of WP_DEBUG errors throughout xprofile.

#7 @boonebgorges
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().

Note: See TracTickets for help on using tickets.