From 6932a5f5589a01fac1cb18150e30aa62fa550772 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 22 Jun 2015 20:54:31 +0000 Subject: [PATCH] Sanitize the class passed to `wp_list_bookmarks()` and allow passing an array. Props ryan, obenland. Fixes #23150. git-svn-id: https://develop.svn.wordpress.org/trunk@32906 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/bookmark-template.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-includes/bookmark-template.php b/src/wp-includes/bookmark-template.php index 95a09f0b08..47bfb4a181 100644 --- a/src/wp-includes/bookmark-template.php +++ b/src/wp-includes/bookmark-template.php @@ -214,6 +214,12 @@ function wp_list_bookmarks( $args = '' ) { $output = ''; + if ( ! is_array( $r['class'] ) ) { + $r['class'] = explode( ' ', $r['class'] ); + } + $r['class'] = array_map( 'sanitize_html_class', $r['class'] ); + $r['class'] = trim( join( ' ', $r['class'] ) ); + if ( $r['categorize'] ) { $cats = get_terms( 'link_category', array( 'name__like' => $r['category_name'],