In case anyone else has this problem, the solution seems to be to replace lines 104 and 105 with:
'subject' => stripslashes($subject),
'body' => stripslashes($output),
I’ve just noticed that my post.php page doesn’t load since my (shared) host upgraded to 5.2.0 – so there may be more problems than only the one that started this thread. I’ve reverted to php4, and all works fine again.