Page 1 of 1

another livejournal update plugin improvement

Posted: Fri Dec 02, 2005 9:24 am
by jerwarren
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.

Code: Select all

$event = $eventData['body'];
$event = preg_replace('@(href|src)=("|\')(' . preg_quote($serendipity['serendipityHTTPPath']) . ')(.*)("|\')(.*)>@imsU', '\1=\2' . $serendipity['baseURL'] . '\4\2\6>', $event);
In case it isn't immediate obvious, the second line just gets added after the already existing first line.

Re: another livejournal update plugin improvement

Posted: Fri Dec 02, 2005 12:10 pm
by garvinhicking
Hi!

That's a great hint, thank you! Just committed to the plugin!

Regards,
Garvin