Repository navigation
Commit 7ed4f03
committed
Media: stop adding crossorigin attributes in the editor.
Fix an issue where editing a post in Chromium 137+ could end in a fatal error and a blank screen when the page loaded any cross-origin resource. `wp_add_crossorigin_attributes()` ran `WP_HTML_Tag_Processor` over the whole document inside an `ob_start()` display handler, where errors cannot be caught. The injected `crossorigin="anonymous"` was not needed in the first place: `Document-Isolation-Policy: isolate-and-credentialless` loads cross-origin scripts, stylesheets, audio and video without credentials instead of blocking them, and forcing a CORS request broke any host that does not send `Access-Control-Allow-Origin`, such as media offloaded to a CDN.
The header is now sent directly by the new `wp_send_document_isolation_policy_header()`, and the editor page is no longer buffered or rewritten. `wp_start_cross_origin_isolation_output_buffer()` and `wp_add_crossorigin_attributes()` are deprecated; the first only sends the header and the second returns the HTML unchanged. `wp_print_media_templates()` no longer adds the attribute to AUDIO and VIDEO tags. Cross-origin isolation and client-side media processing are unaffected.
Follow-up to [61844], [62048], [62819].
Props b0b3k, khokansardar, arkaprabhachowdhury, westonruter, andrewserong, algorithmsunlocks, sabernhardt, swissspidy, adamsilverstein.
Fixes #65930. See #65673.
git-svn-id: https://develop.svn.wordpress.org/trunk@64489 602fd350-edb4-49c9-b593-d223f7449a821 parent 8cffc95 commit 7ed4f03
4 files changed
Lines changed: 131 additions & 361 deletions
File tree
- src/wp-includes
- tests/phpunit/tests/media
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6600 | 6600 | | |
6601 | 6601 | | |
6602 | 6602 | | |
| 6603 | + | |
| 6604 | + | |
| 6605 | + | |
| 6606 | + | |
| 6607 | + | |
| 6608 | + | |
| 6609 | + | |
| 6610 | + | |
| 6611 | + | |
| 6612 | + | |
| 6613 | + | |
| 6614 | + | |
| 6615 | + | |
| 6616 | + | |
| 6617 | + | |
| 6618 | + | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
| 6622 | + | |
| 6623 | + | |
| 6624 | + | |
| 6625 | + | |
| 6626 | + | |
| 6627 | + | |
| 6628 | + | |
| 6629 | + | |
| 6630 | + | |
| 6631 | + | |
| 6632 | + | |
| 6633 | + | |
| 6634 | + | |
| 6635 | + | |
| 6636 | + | |
| 6637 | + | |
| 6638 | + | |
| 6639 | + | |
| 6640 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
| |||
1596 | 1590 | | |
1597 | 1591 | | |
1598 | 1592 | | |
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 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | 1593 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6648 | 6648 | | |
6649 | 6649 | | |
6650 | 6650 | | |
| 6651 | + | |
| 6652 | + | |
| 6653 | + | |
6651 | 6654 | | |
6652 | | - | |
| 6655 | + | |
6653 | 6656 | | |
6654 | | - | |
| 6657 | + | |
6655 | 6658 | | |
6656 | 6659 | | |
6657 | 6660 | | |
6658 | 6661 | | |
6659 | 6662 | | |
6660 | | - | |
| 6663 | + | |
6661 | 6664 | | |
6662 | 6665 | | |
6663 | 6666 | | |
6664 | | - | |
| 6667 | + | |
6665 | 6668 | | |
6666 | 6669 | | |
6667 | 6670 | | |
| |||
6677 | 6680 | | |
6678 | 6681 | | |
6679 | 6682 | | |
6680 | | - | |
| 6683 | + | |
6681 | 6684 | | |
6682 | 6685 | | |
6683 | 6686 | | |
| |||
6686 | 6689 | | |
6687 | 6690 | | |
6688 | 6691 | | |
6689 | | - | |
| 6692 | + | |
6690 | 6693 | | |
6691 | 6694 | | |
6692 | 6695 | | |
6693 | 6696 | | |
6694 | | - | |
| 6697 | + | |
6695 | 6698 | | |
6696 | 6699 | | |
6697 | | - | |
| 6700 | + | |
6698 | 6701 | | |
6699 | 6702 | | |
6700 | 6703 | | |
6701 | 6704 | | |
6702 | 6705 | | |
6703 | | - | |
| 6706 | + | |
| 6707 | + | |
| 6708 | + | |
| 6709 | + | |
| 6710 | + | |
6704 | 6711 | | |
6705 | | - | |
| 6712 | + | |
| 6713 | + | |
| 6714 | + | |
| 6715 | + | |
6706 | 6716 | | |
6707 | | - | |
| 6717 | + | |
| 6718 | + | |
| 6719 | + | |
| 6720 | + | |
| 6721 | + | |
6708 | 6722 | | |
6709 | 6723 | | |
6710 | 6724 | | |
6711 | | - | |
| 6725 | + | |
6712 | 6726 | | |
6713 | 6727 | | |
6714 | | - | |
6715 | | - | |
6716 | | - | |
6717 | | - | |
6718 | | - | |
6719 | | - | |
6720 | | - | |
6721 | | - | |
6722 | | - | |
6723 | | - | |
6724 | | - | |
6725 | | - | |
6726 | | - | |
6727 | | - | |
6728 | | - | |
6729 | | - | |
6730 | | - | |
6731 | | - | |
6732 | | - | |
6733 | | - | |
6734 | | - | |
6735 | | - | |
6736 | | - | |
6737 | | - | |
6738 | | - | |
6739 | | - | |
6740 | | - | |
6741 | | - | |
6742 | | - | |
6743 | | - | |
6744 | | - | |
6745 | | - | |
6746 | | - | |
6747 | | - | |
6748 | | - | |
6749 | | - | |
6750 | | - | |
6751 | | - | |
6752 | | - | |
6753 | | - | |
6754 | | - | |
6755 | | - | |
6756 | | - | |
6757 | | - | |
6758 | | - | |
6759 | | - | |
6760 | | - | |
6761 | | - | |
6762 | | - | |
6763 | | - | |
6764 | | - | |
6765 | | - | |
6766 | | - | |
6767 | | - | |
6768 | | - | |
6769 | | - | |
6770 | | - | |
| 6728 | + | |
6771 | 6729 | | |
6772 | | - | |
6773 | | - | |
6774 | | - | |
6775 | | - | |
6776 | | - | |
6777 | | - | |
6778 | | - | |
6779 | | - | |
6780 | | - | |
6781 | | - | |
6782 | | - | |
6783 | | - | |
6784 | | - | |
6785 | | - | |
6786 | | - | |
6787 | | - | |
6788 | | - | |
6789 | | - | |
6790 | | - | |
6791 | | - | |
6792 | | - | |
6793 | | - | |
6794 | | - | |
6795 | | - | |
| 6730 | + | |
6796 | 6731 | | |
6797 | 6732 | | |
0 commit comments