Page 1 of 1

Full path to images in rss feed?

Posted: Mon Jan 13, 2014 8:42 pm
by Don Chambers
How does s9y supply the full path to an image in an rss feed when the image is inserted into the entry as only a relative path?

For example, I have an image that is inserted via the media manager into the entry as "/uploads/myimage1.png". I have done this on both a live site, as well as a test site.

On the test site, the rss2 feed includes the full path to the image, ie "http://mydomain.com/uploads/myimage1.png". However, the exact same entry on a live site only includes the relative path in the rss2 feed, ie "/uploads/myimage1.png". Both are running s9y 1.7.2 and PHP 5.2.17.

Re: Full path to images in rss feed?

Posted: Tue Jan 14, 2014 10:20 am
by garvinhicking
Don Chambers wrote:How does s9y supply the full path to an image in an rss feed when the image is inserted into the entry as only a relative path?
In include/functions_rss.inc.php is the print_entries_rss function that holds this line of code:

Code: Select all

$entry['body'] = preg_replace('@(href|src)=("|\')(' . preg_quote($serendipity['serendipityHTTPPath']) . ')(.*)("|\')(.*)>@imsU', '\1=\2' . $serendipity['baseURL'] . '\4\2\6>', $entry['body']);
This is there to replace the relative links. So the only way I see this working in one install and not the other with identical markups is, that the "serendipityHTTPPath" url variable might not be set to "/" for example, so it would never match a <a href="/...">- ot maybe even if baseURL is not set to the full URL of the blog?

HTH,
Garvin