Skip to content
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

Global Styles: Make the config resilient to changes to safecss_filter_attr() #30888

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Global Styles: Make the config resilient to changes to safecss_filter_attr() #30888

merged 2 commits into from
Apr 22, 2021

Commits on Apr 16, 2021

  1. Test remove_insecure_properties() isn't too strict

    The CSS values in the theme object can not be unsafe, but we also
    shouldn't be so strict that values that would be accepted by a CSS
    parser are rejected.
    p-jackson committed Apr 16, 2021
    Configuration menu
    Copy the full SHA
    de455fc View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2021

  1. Harden remove_insecure_properties() to implementation detail changes

    The method was assuming a particular implementation of the
    safecss_filter_attr() function. In the future it could do something like
    remove whitespace around the ":", or convert lowercase colours (#abcabc)
    to uppercase (#ABCABC), which would break saving of Global Styles in
    Gutenberg. In general it doesn't feel like we should assume filtering
    functions will return the input unchanged.
    
    Switching the semantics of the check from "style was unchanged" to
    "style was not stripped" fits better with the description of the
    safecss_filter_attr() function.
    p-jackson committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    1b385d1 View commit details
    Browse the repository at this point in the history