diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 5101f70959a..f8db5833635 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -397,6 +397,18 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $tmpevent['desc'] = $event->description; if (!empty($event->image)) { $tmpevent['image'] = $GLOBALS['website']->virtualhost.'/medias/'.$event->image; + } else { + include_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; + $tmpimage = getImageFromHtmlContent($event->content); + if ($tmpimage) { + if (strpos($tmpimage, '/') === 0) { // If $tmpimage is an absolute path + $tmpevent['image'] = $GLOBALS['website']->virtualhost.$tmpimage; + } elseif (stripos($tmpimage, 'http:') === 0) { // If $tmpimage is a full URI + $tmpevent['image'] = $tmpimage; + } else { + $tmpevent['image'] = $GLOBALS['website']->virtualhost.'/medias/'.$tmpimage; + } // TODO If $tmpimage is "data:..." + } } $tmpevent['content'] = $event->content;