another livejournal update plugin improvement
Posted: Fri Dec 02, 2005 9:24 am
the lj plugin doesn't currently make sure that any relative URLs get converted to absolute, so I yanked the code from the rss generater which does that, and slapped it into the lj plugin and it works like a charm.
In case it isn't immediate obvious, the second line just gets added after the already existing first line.
Code: Select all
$event = $eventData['body'];
$event = preg_replace('@(href|src)=("|\')(' . preg_quote($serendipity['serendipityHTTPPath']) . ')(.*)("|\')(.*)>@imsU', '\1=\2' . $serendipity['baseURL'] . '\4\2\6>', $event);