Make WordPress Core


Ignore:
Timestamp:
01/21/2025 10:57:04 PM (14 months ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r58709 r59677  
    896896
    897897        case 'user_description':
     898        case 'pre_term_description':
    898899        case 'pre_user_description':
    899             $tags             = $allowedtags;
    900             $tags['a']['rel'] = true;
     900            $tags                = $allowedtags;
     901            $tags['a']['rel']    = true;
     902            $tags['a']['target'] = true;
    901903            /** This filter is documented in wp-includes/kses.php */
    902904            return apply_filters( 'wp_kses_allowed_html', $tags, $context );
Note: See TracChangeset for help on using the changeset viewer.