forked from Wavyzz/dolibarr
Fix image in RSS
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user