#17977 closed enhancement (fixed)
Allow rel attributes on links in KSES
Reported by: | joostdevalk | Owned by: | joostdevalk |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Formatting | Keywords: | has-patch dev-feedback 3.4-early |
Focuses: | Cc: |
Description
Due to the recent Google changes, authors will be wanting to add rel="me" to the links in their author descriptions on blogs they write on. Currently though, rel="me" (and every other rel) is stripped out because it's not an allowed attribute.
I propose we allow it, there seems to be no harm in allowing it and it would help people out. Patch attached.
Attachments (1)
Change History (21)
#1
@
13 years ago
- Milestone changed from Awaiting Review to 3.3
Good to me as long as there are no security issues.
#3
@
13 years ago
Ugh, just thought of an issue. The way this patch is done right now, you'd probably also be able to add rel="me" and rel="author" etc. in a link in the comments which is unwanted behavior I suppose.
#5
in reply to:
↑ 4
@
13 years ago
Replying to nacin:
We could add it to allowedposttags only.
It's already allowed there, I'd like it allowed in author bio's...
#6
@
13 years ago
This whole thing is a mess thanks to how ancient the kses library is and how the globals and constants were implemented there.
Something like this should work as a one-off:
remove_filter( 'pre_user_description', 'wp_filter_kses' ); add_filter( 'pre_user_description', 'wp_filter_pre_user_description' ); function wp_filter_pre_user_description( $data ) { $allowedtags = $GLOBALS['allowedtags']; if ( isset( $allowedtags['a'] ) ) $allowedtags['a']['rel'] = array(); return addslashes( wp_kses( stripslashes( $data ), $allowedtags ) ); }
#7
@
13 years ago
Ugh that is ugly. Anyway we can fix that in a less ugly way? If it involves rewriting kses, i'm up for that with some help :)
#8
@
13 years ago
- Keywords 3.4-early added
- Milestone changed from 3.3 to Future Release
At this point we're past freeze, and and are switching over to "bugs only" mode. Punting and marking for 3.4-early. If you guys figure out what to do about kses etc., this ticket can be one of the first things in 3.4.
Patch of KSES filter to allow rel attribute on links.