Skip to content

Commit fd25b3d

Browse files
authored
Prevent PHP error on invalid excluded extensions check (#45046)
1 parent 1afa590 commit fd25b3d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
Prevent PHP error when checking for available Gutenberg extensions.

projects/plugins/jetpack/class.jetpack-gutenberg.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ public static function get_available_extensions( $allowed_extensions = null ) {
328328
$exclusions = get_option( 'jetpack_excluded_extensions', array() );
329329
$allowed_extensions = $allowed_extensions === null ? self::get_jetpack_gutenberg_extensions_allowed_list() : $allowed_extensions;
330330

331+
// Avoid errors if option data is not as expected.
332+
if ( ! is_array( $exclusions ) ) {
333+
$exclusions = array();
334+
}
335+
331336
return array_diff( $allowed_extensions, $exclusions );
332337
}
333338

0 commit comments

Comments
 (0)