WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/21/2015 02:42:30 AM (4 years ago)
Author:
pento
Message:

Texturize: Transform & into & in tag attributes.

[35709] was overly broad, and stopped transforming & characters within tag attributes. So that sites aren't generating invalid HTML, we need to restore this functionality, while continuing to not transform & within blocked tags.

Fixes #35008 for trunk.

File:
1 edited

Legend:

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

    r35904 r36036  
    234234            } else {
    235235                // This is an HTML element delimiter.
     236
     237                // Replace each & with & unless it already looks like an entity.
     238                $curl = preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&', $curl );
     239
    236240                _wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags );
    237241            }
Note: See TracChangeset for help on using the changeset viewer.