Make WordPress Core


Ignore:
Timestamp:
06/24/2024 03:02:41 PM (6 months ago)
Author:
audrasjb
Message:

Grouped Backports to the 6.5 branch.

  • Editor: Fix Path Traversal issue on Windows in Template-Part Block.
  • Editor: Sanitize Template Part HTML tag on save.
  • HTML API: Run URL attributes through esc_url().

Merges [58470], [58471], [58472] and [58473] to the 6.5 branch.
Props xknown, peterwilsoncc, jorbin, bernhard-reiter, azaozz, dmsnell, gziolo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5/src/wp-includes/html-api/class-wp-html-tag-processor.php

    r57815 r58474  
    29692969            $updated_attribute = $name;
    29702970        } else {
    2971             $escaped_new_value = esc_attr( $value );
     2971            $comparable_name = strtolower( $name );
     2972
     2973            /*
     2974             * Escape URL attributes.
     2975             *
     2976             * @see https://html.spec.whatwg.org/#attributes-3
     2977             */
     2978            $escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes() ) ? esc_url( $value ) : esc_attr( $value );
    29722979            $updated_attribute = "{$name}=\"{$escaped_new_value}\"";
    29732980        }
Note: See TracChangeset for help on using the changeset viewer.