Go to https://www.tdsexperience.com/files/lj-autoupdate.txt for a slightly-modified version of this script. It fixes two issues:
- The slashes in the subject field weren’t being escaped.
- LJ added extra line breaks, doubling the space between paragraphs.
If you’re using a customized version of this function (like for friends-only posting), then simply make the following changes:
Find the line
$subject = $post_title;
and replace it with:
$subject = stripslashes(stripslashes($post_title));
Then find
$content = convert_chars($content, 'html');
and add after it:
$content = wpautop($content);
$content = "<lj-raw>".$content."</lj-raw>";
That’ll fix the aforementioned problems.