From a79b4ef4c92a012cbb6ddeb925779d9d7bd84dcd Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 21 Jan 2025 22:59:18 +0000 Subject: [PATCH] Formatting: Preserve `target="_blank"` in Biographical Info and Category Description. This changeset ensures the `target="_blank"` attribute is preserved when adding links in the Biographical Info and Category Description fields. Previously, this attribute was being stripped by the KSES sanitization process. Additionally, new unit tests have been added to verify the preservation of the `target="_blank"` attribute in these specific contexts. Props lovewpmu, miqrogroove, bsutcliffe, sjefen6, nofearinc, nacin, harmr, blogitsolutions, stefahn, nirajgirixd, martinkrcho, spacedmonkey, sukhendu2002, audrasjb, gaellebesson, nuryko, guillaumeturpin, maximemeganck, ranafge, azaozz, joedolson, rinkalpagdar, mikinc860. Fixes #12056. Built from https://develop.svn.wordpress.org/trunk@59677 git-svn-id: http://core.svn.wordpress.org/trunk@59020 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/kses.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/kses.php b/wp-includes/kses.php index cd30d845f8..ebb4a761b1 100644 --- a/wp-includes/kses.php +++ b/wp-includes/kses.php @@ -895,9 +895,11 @@ function wp_kses_allowed_html( $context = '' ) { return $tags; case 'user_description': + case 'pre_term_description': case 'pre_user_description': - $tags = $allowedtags; - $tags['a']['rel'] = true; + $tags = $allowedtags; + $tags['a']['rel'] = true; + $tags['a']['target'] = true; /** This filter is documented in wp-includes/kses.php */ return apply_filters( 'wp_kses_allowed_html', $tags, $context ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5fd46c131d..3167bb62ed 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59676'; +$wp_version = '6.8-alpha-59677'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.