another livejournal update plugin improvement

Creating and modifying plugins.
Post Reply
jerwarren

another livejournal update plugin improvement

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: another livejournal update plugin improvement

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply