Make WordPress Core


Ignore:
Timestamp:
12/21/2015 02:45:43 AM (9 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.

Merge of [36036] to the 4.4 branch.

Fixes #35008.

File:
1 edited

Legend:

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

    r35815 r36037  
    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.