From 744cc75cd1d5d6a42168e23156259226d0bdca2e Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 22 Jun 2015 20:55:28 +0000 Subject: [PATCH] Sanitize the class passed to `wp_list_bookmarks()` and allow passing an array. Props ryan, obenland. Fixes #23150. Built from https://develop.svn.wordpress.org/trunk@32906 git-svn-id: http://core.svn.wordpress.org/trunk@32877 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/bookmark-template.php | 6 ++++++ wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 95a09f0b08..47bfb4a181 100644 --- a/wp-includes/bookmark-template.php +++ b/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'], diff --git a/wp-includes/version.php b/wp-includes/version.php index cc197988a3..a4d6979e5a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32905'; +$wp_version = '4.3-alpha-32906'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.