Make WordPress Core


Ignore:
Timestamp:
06/24/2024 03:08:05 PM (2 years ago)
Author:
audrasjb
Message:

Grouped Backports to the 6.4 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.4 branch.
Props xknown, peterwilsoncc, jorbin, bernhard-reiter, azaozz, dmsnell, gziolo.

File:
1 edited

Legend:

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

    r57117 r58475  
    20722072            $updated_attribute = $name;
    20732073        } else {
    2074             $escaped_new_value = esc_attr( $value );
     2074            $comparable_name = strtolower( $name );
     2075
     2076            /*
     2077             * Escape URL attributes.
     2078             *
     2079             * @see https://html.spec.whatwg.org/#attributes-3
     2080             */
     2081            $escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes() ) ? esc_url( $value ) : esc_attr( $value );
    20752082            $updated_attribute = "{$name}=\"{$escaped_new_value}\"";
    20762083        }
Note: See TracChangeset for help on using the changeset viewer.