mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
9fc546b2ce
Provides a custom decoder for strings coming from HTML attributes and markup. This custom decoder is necessary because of deficiencies in PHP's `html_entity_decode()` function: - It isn't aware of 720 of the possible named character references in HTML, leaving many out that should be translated. - It isn't aware of the ambiguous ampersand rule, which allows conversion of character references in certain contexts when they are missing their closing `;`. - It doesn't draw a distinction for the ambiguous ampersand rule when decoding attribute values instead of markup values. - Use of `html_entity_decode()` requires manually passing non-default paramter values to ensure it decodes properly. This decoder also provides some conveniences, such as making a single-pass and interruptable decode operation possible. This will provide a number of opportunities to optimize detection and decoding of things like value prefixes, and whether a value contains a given substring. Developed in https://github.com/WordPress/wordpress-develop/pull/6387 Discussed in https://core.trac.wordpress.org/ticket/61072 Props dmsnell, gziolo, jonsurrell, jorbin, westonruter, zieladam. Fixes #61072. Built from https://develop.svn.wordpress.org/trunk@58281 git-svn-id: http://core.svn.wordpress.org/trunk@57741 1a063a9b-81f0-0310-95a4-ce76da25c4cd |
||
---|---|---|
.. | ||
class-wp-html-active-formatting-elements.php | ||
class-wp-html-attribute-token.php | ||
class-wp-html-decoder.php | ||
class-wp-html-open-elements.php | ||
class-wp-html-processor-state.php | ||
class-wp-html-processor.php | ||
class-wp-html-span.php | ||
class-wp-html-tag-processor.php | ||
class-wp-html-text-replacement.php | ||
class-wp-html-token.php | ||
class-wp-html-unsupported-exception.php | ||
html5-named-character-references.php |