studiopress / genesis-sample

This is the sample theme created for the Genesis Framework.
https://demo.studiopress.com/genesis-sample/
528 stars 284 forks source link

Make version null to prevent poor encoding and removal of any duplicate font families #346

Closed wpsmith closed 3 years ago

wpsmith commented 4 years ago

If a user changes fonts-url to something like https://fonts.googleapis.com/css2?family=Alex+Brush&family=Open+Sans:wght@400;700;800&display=swap, WordPress's add_query_arg breaks the URL with wp_parse_str and urlencode_deep as Google cannot handle the encodings.

How to test

  1. Change fonts-url in config/appearance to https://fonts.googleapis.com/css2?family=Alex+Brush&family=Open+Sans:wght@400;700;800&display=swap
  2. Load page & check the output link tag for id="genesis-sample-fonts-css".

Documentation

PR includes documentation.

Suggested changelog entry

Notes

See WP Core Tickets: https://core.trac.wordpress.org/ticket/50106 and https://core.trac.wordpress.org/ticket/49742.

dreamwhisper commented 3 years ago

Thanks @wpsmith! Updating this to null does prevent the reported issue.

Before this is merged, we'll need to ignore the phpcs missing version message.

Resource version not set in call to wp_enqueue_style(). This means new versions of the style will not always be loaded due to browser caching. (WordPress.WP.EnqueuedResourceParameters.MissingVersion)

dreamwhisper commented 3 years ago

Closed in favor of #374