Commit a13fbba
committed
KSES: Decode style attribute before sending to safecss_filter_attr().
`safecss_filter_attr()` assumes that it receives already-unescaped HTML
attribute values. For example, consider the raw HTML string:
style="background:url("bg.png")"
This should be decoded and passed into `safecss_filter_attr()` as:
background:url("bg.png")
Unfortuantely this hasn’t been done in `wp_kses_attr_check()`, which
takes the output from `wp_kses_hair()` and sends it directly to the
filtering function.
In this patch, `wp_kses_attr_check()` unescapes the `style` attribute,
filters it, and then re-escapes it when updating the style value.
Tests added by Codex
Developed in: WordPress#11868
Discussed in: https://core.trac.wordpress.org/ticket/65270
Props dmsnell, westonruter.
Fixes #65270.
git-svn-id: https://develop.svn.wordpress.org/trunk@62433 602fd350-edb4-49c9-b593-d223f7449a821 parent f19efd0 commit a13fbba
2 files changed
Lines changed: 56 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1556 | 1556 | | |
1557 | 1557 | | |
1558 | 1558 | | |
1559 | | - | |
| 1559 | + | |
| 1560 | + | |
1560 | 1561 | | |
1561 | 1562 | | |
1562 | 1563 | | |
| |||
1565 | 1566 | | |
1566 | 1567 | | |
1567 | 1568 | | |
1568 | | - | |
1569 | | - | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1570 | 1574 | | |
1571 | 1575 | | |
1572 | 1576 | | |
| |||
2554 | 2558 | | |
2555 | 2559 | | |
2556 | 2560 | | |
2557 | | - | |
| 2561 | + | |
2558 | 2562 | | |
2559 | | - | |
| 2563 | + | |
2560 | 2564 | | |
2561 | 2565 | | |
2562 | 2566 | | |
| |||
2568 | 2572 | | |
2569 | 2573 | | |
2570 | 2574 | | |
| 2575 | + | |
2571 | 2576 | | |
2572 | 2577 | | |
2573 | 2578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1583 | 1583 | | |
1584 | 1584 | | |
1585 | 1585 | | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1586 | 1632 | | |
1587 | 1633 | | |
1588 | 1634 | | |
| |||
0 commit comments