diff --git a/src/fields/OembedField.php b/src/fields/OembedField.php index 08b1747..94fca01 100755 --- a/src/fields/OembedField.php +++ b/src/fields/OembedField.php @@ -124,13 +124,17 @@ public function normalizeValue($value, ElementInterface $element = null) } // If array with `url` attribute, that’s our url so update the value - if ($url = ArrayHelper::getValue($value, 'url')) { - // Run `getValue` twice to avoid https://github.com/wrav/oembed/issues/74 - $value = ArrayHelper::getValue($value, 'url', $url); + if (is_array($value)) { + $value = ArrayHelper::getValue($value, 'url'); + } + + // Run `getValue` twice to avoid https://github.com/wrav/oembed/issues/74 + if (is_array($value)) { + $value = ArrayHelper::getValue($value, 'url'); } // If URL string, return an instance of `OembedModel` - if (UrlHelper::isFullUrl($value)) { + if (is_string($value) && UrlHelper::isFullUrl($value)) { return new OembedModel($value); }