Opened 2 months ago
#63997 new defect (bug)
wptexturize incorrectly escapes attribute quotes after encountering greater-than sign
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.8.2 |
| Component: | Formatting | Keywords: | |
| Focuses: | Cc: |
Description
This appears to be a more generalized version of ticket https://core.trac.wordpress.org/ticket/63426.
The following examples could be run on the the 'init' action hook.
Using the greater-than character within attribute values causes the wptexturize function to incorrectly convert all proceeding quotation marks to decimal code.
<?php
$div_string = '<div data-template="Label <% value %>" data-label="{A \'message\' string}">Content</div>'
echo wptexturize( $div_string );
// Output:
// <div data-template="Label <% value %>” data-label=”{A ‘message’ string}”>Content</div>
// Expected output:
// <div data-template="Label <% value %>"; data-label="{A ‘message’ string}">Content</div>
This attribute quote escaping "resets" when a less-than symbol is encountered.
$div_string = '<div data-break="3>2" data-broken="b" data-fixer="<" data-working="1">Content</div>'; echo wptexturize( $div_string ); // Output: // <div data-break="3>2″ data-broken=”b” data-fixer=”<" data-working="1">Content</div>
Note: See
TracTickets for help on using
tickets.