diff --git a/modules/views_rss_core/views_rss_core.inc b/modules/views_rss_core/views_rss_core.inc index ecb5f4f..20962ba 100644 --- a/modules/views_rss_core/views_rss_core.inc +++ b/modules/views_rss_core/views_rss_core.inc @@ -136,18 +136,20 @@ function views_rss_core_preprocess_channel_image(&$variables) { } // Get image's width and height. - $image = Drupal::service('image.factory')->get($image_path); - if (!$image->isValid()) { - $variables['elements'][0]['value']['width'] = [ - '#type' => 'html_tag', - '#tag' => 'width', - '#value' => $image->getWidth(), - ]; - $variables['elements'][0]['value']['height'] = [ - '#type' => 'html_tag', - '#tag' => 'height', - '#value' => $image->getHeight(), - ]; + if (strpos($image_path, 'https://') !== FALSE && strpos($image_path, 'http://') !== FALSE) { + $image = Drupal::service('image.factory')->get($image_path); + if (!$image->isValid()) { + $variables['elements'][0]['value']['width'] = [ + '#type' => 'html_tag', + '#tag' => 'width', + '#value' => $image->getWidth(), + ]; + $variables['elements'][0]['value']['height'] = [ + '#type' => 'html_tag', + '#tag' => 'height', + '#value' => $image->getHeight(), + ]; + } } }