WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/02/2016 04:16:00 AM (3 years ago)
Author:
jorbin
Message:

Formatting: Allow KSES custom elements with hyphens

The W3C Custom Elements spec (http://www.w3.org/TR/custom-elements/#concepts) allows you to use your own custom DOM elements/tags. One of the main requirements is that the tag name "must contain a U+002D HYPHEN-MINUS character". This adjusts KSES to allow it.

Fixes #34105.
Props batmoo.

File:
1 edited

Legend:

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

    r38121 r38511  
    782782    // Allow HTML comments
    783783
    784     if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches))
     784    if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches))
    785785        return '';
    786786    // It's seriously malformed
Note: See TracChangeset for help on using the changeset viewer.