[wp-trac] [WordPress Trac] #17977: Allow rel attributes on links in KSES

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 6 16:35:25 UTC 2011


#17977: Allow rel attributes on links in KSES
------------------------------------+--------------------------
 Reporter:  joostdevalk             |       Owner:  joostdevalk
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  3.3
Component:  Formatting              |     Version:  3.2
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+--------------------------

Comment (by nacin):

 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 )
 );
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17977#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list