You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some comics' RSS feeds (such as Dumm Comics) use relative paths to their
images' SRC and links' HREF attributes. While this is technically an error
in the RSS feed (since feeds are supposed to be portable), other readers
(notably Google Reader) rewrite the relative paths, which helps prevent the
problem.
For whatever it's worth, for my own RSS feeds I have written a function
"rewriteRelative" which fixes relative paths; perhaps it would be useful to
integrate it into FonF:
// Rewrite all relative links in a chunk of HTML/XML/etc. to point to the
appropriate place
function rewriteRelative($html, $base) {
// generate server-only replacement for root-relative URLs
$server = preg_replace('@^([^\:]*)://([^/*]*)(/|$).*@', '\1://\2/',
$base);
// replace root-relative URLs
$html = preg_replace('@\<([^>]*) (href|src)="/([^"]*)"@i',
'<\1 \2="' . $server . '\3"', $html);
// replace base-relative URLs (kludgy, but I couldn't get ! to work)
$html = preg_replace('@\<([^>]*)
(href|src)="(([^\:"])*|([^"]*:[^/"].*))"@i',
'<\1 \2="' . $base . '\3"', $html);
return $html;
}
It's a little kludgy but it does the job.
Original issue reported on code.google.com by fluffy%[email protected] on 6 May 2009 at 3:53
The text was updated successfully, but these errors were encountered:
After looking into it a bit more, it appears that SimplePie IS already rewriting
content links, but for some reason the images aren't displaying, even though
they're
getting rewritten to something that's technically valid.
I wonder if this is more a case of the site in question (dummcomics.com) being
a bit
overzealous with hotlink prevention, since if I manually load one of the image
URLs,
it shows up, and then promptly disappears from FonF - and stays disappeared
when I go
to the site itself (until I reload).
Original issue reported on code.google.com by
fluffy%[email protected]
on 6 May 2009 at 3:53The text was updated successfully, but these errors were encountered: