Skip to content

Commit 40cc5fd

Browse files
committed
fix: PHP notice when migrating from 1.0.8 or lower version
1 parent 0959572 commit 40cc5fd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ If you're not using any of the supported plugins and theme, you can write the cu
5151

5252
### 1.0.17 ###
5353
- New: Users can now share non-personal usage data to help us test and develop better products. ( https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking )
54+
- Fix: "PHP Notice: Trying to access array offset on value of type bool" when user is migrating from 1.0.8 or lower version.
5455

5556
### 1.0.16 ###
5657
- Improvement: Updated warning strings incase of wrong project ID.

classes/class-custom-typekit-fonts-update.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,12 @@ private function v_1_0_8() {
9696
$typekit = new Custom_Typekit_Fonts();
9797
$custom_typekit = get_option( 'custom-typekit-fonts' );
9898
$option = array();
99-
$option['custom-typekit-font-id'] = sanitize_text_field( $custom_typekit['custom-typekit-font-id'] );
100-
$option['custom-typekit-font-details'] = $typekit->get_custom_typekit_details( $custom_typekit['custom-typekit-font-id'] );
99+
$option['custom-typekit-font-id'] = isset( $custom_typekit['custom-typekit-font-id'] ) ? sanitize_text_field( $custom_typekit['custom-typekit-font-id'] ) : '';
100+
$option['custom-typekit-font-details'] = isset( $custom_typekit['custom-typekit-font-id'] ) ? $typekit->get_custom_typekit_details( $custom_typekit['custom-typekit-font-id'] ) : '';
101101

102102
update_option( 'custom-typekit-fonts', $option );
103103
}
104-
105104
}
106-
107105
}
108106

109107
/**

languages/custom-typekit-fonts.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgstr ""
55
"Project-Id-Version: Custom Adobe Fonts (Typekit) 1.0.17\n"
66
"Report-Msgid-Bugs-To: "
77
"https://wordpress.org/support/plugin/custom-typekit-fonts\n"
8-
"POT-Creation-Date: 2020-06-15 05:45:18+00:00\n"
8+
"POT-Creation-Date: 2020-06-15 10:43:58+00:00\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=utf-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ If you're not using any of the supported plugins and theme, you can write the cu
5151

5252
= 1.0.17 =
5353
- New: Users can now share non-personal usage data to help us test and develop better products. ( https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking )
54+
- Fix: "PHP Notice: Trying to access array offset on value of type bool" when user is migrating from 1.0.8 or lower version.
5455

5556
= 1.0.16 =
5657
- Improvement: Updated warning strings incase of wrong project ID.

0 commit comments

Comments
 (0)