From 13e893efff12a058f0f540c8dffe2413574a42a3 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Mon, 19 Jul 2021 14:51:34 +0100 Subject: [PATCH] Ensure that the key is set --- php/class-media.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/class-media.php b/php/class-media.php index 58c9a1b6f..6e5ca50ac 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -769,6 +769,9 @@ function ( $part ) { * @return array The array of found transformations within the string. */ public function get_transformations_from_string( $str, $type = 'image' ) { + if ( ! isset( Api::$transformation_index[ $type ] ) ) { + return array(); + } $params = Api::$transformation_index[ $type ];