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

There are a possibility that faulty font cache may be stored in the 'kirki_downloaded_font_files' option. #2521

Open
sebastianthulin opened this issue Dec 5, 2023 · 0 comments

Comments

@sebastianthulin
Copy link

sebastianthulin commented Dec 5, 2023

Issue description:

There are a possibility that faulty font cache may be stored in the 'kirki_downloaded_font_files' option. This option is not checked before store, and will not be updated with correct values later on.

A missing font cache, will result in a GDPR issue since the fonts are linked to google servers.

In my case. "/OK" string has been stored in the option. It might be suitable to do a value check here:
https://github.com/themeum/kirki/blob/master/kirki-packages/module-webfonts/src/Webfonts/Downloader.php#L125

if ( $change && is_array( $stored ) && !empty( $stored ) ) {
update_option( 'kirki_downloaded_font_files', $stored );
}

Possibly, also in the below scope (to be able to mitigate installs that already have stored faulty values).
https://github.com/themeum/kirki/blob/master/kirki-packages/module-webfonts/src/Webfonts/Downloader.php#L68

$stored     = get_option( 'kirki_downloaded_font_files', array() );
if(!is_array($stored)) {
delete_option('kirki_downloaded_font_files'); 
$stored = array();
}

Version used:

5.0.0

Using theme_mods or options?

Not relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant