-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cover image cannot be added without unfiltered_html capability #2539
Comments
The attribute ends up being stripped by |
Tested and confirmed that the Tested on bh.testjetpack.blog/multi/ (as a user with administrator rights) running WordPress 4.9.6 Multisite and Gutenberg 3.1.0 using Firefox 60.0.2 on macOS 10.13.5. |
(after two long days of head scratching, what I did wrong in my custom block): |
and for others having this problem: my very simple workaround (not a solution!) is using this very old, but still fully functional plugin by automattic: https://wordpress.org/plugins/unfiltered-mu/ |
This is not a multisite only issue. All you need to do to replicate this issue is add |
Given that this functionality is actually in WordPress core and not in Gutenberg, there is no way a pull request to this repo can be created to fix this issue. However, it appears that this ticket is likely dependent on this core trac ticket: https://core.trac.wordpress.org/ticket/37134 |
You could get down a deep rabbit hole here of trying to modify kses.php to support more advanced CSS through that core trac ticket, but I think the more immediate solution for Gutenberg is to only allow people with That would be possible if #4155 lands. |
Summary:Any user without the This also means any users without that capability cannot use blocks that insert CSS using those characters, such as the Cover Image block. Default roles without that capability are Author and below on single site and Administrator and below on multisite. Potential solutions:
I think 2 is the better solution here, but it will need lots of review, as it opens up potential security issues. |
Since it was only linked by reference, noting that there's additional context to be found in #2540 as well (reiterates/validates much of the same findings as @earnjam in #2539 (comment)). |
Renamed the issue to reflect that, as best I can tell, this has nothing to do with multisite, and more to do with the |
Discovered this one when I was working on tests that check that I can confirm it is to do with the Looking at the solutions proposed in #2539 (comment) , couldn't we do both? If we change the markup saved so that it works with the current state of Does that sound reasonable? |
cc @joemcgill who'd mentioned some issues with trying the idea of an
https://wordpress.slack.com/archives/C02QB2JS7/p1536338278000100 |
To fix this, we need to modify
Some notes about this solution:
|
Core ticket https://core.trac.wordpress.org/ticket/45067 |
Can we close this based on https://core.trac.wordpress.org/changeset/43781 ? |
Tested with an |
When adding a Cover Image block to a post, the resulting
<section>
element is supposed to have astyle
attribute with a background image:However, testing Gutenberg 0.9.0 as an admin user on a Multisite network, the
style
attribute is stripped, resulting in a section with no background image:At a glance, it's because in Multisite regular admins don't have the
unfiltered_html
capability, only super admins do.The text was updated successfully, but these errors were encountered: