Skip to content
Open
8 changes: 8 additions & 0 deletions plugins/system/schemaorg/src/Extension/Schemaorg.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ public function onBeforeCompileHead(BeforeCompileHeadApplicationEvent $event): v

$itemSchema = $localSchema->toArray();

if (!empty($itemSchema['image'])) {
$url = $itemSchema['image'] ?? '';

if (!preg_match('#^(https?:)?//#i', $url)) {
$itemSchema['image'] = Uri::root() . HTMLHelper::_('cleanImageUrl', $url)->url;
}
}

$baseSchema['@graph'][] = $itemSchema;
}
}
Expand Down