Thanks Martin, that fixed it for my customer's site.
@saxcbr @Cary @cdetdi @Mac Fly please try copying the above file into your shops.
You can then try resending an IPN from your Paypal account (finding it is tortuous):
log in to PP, hit cog > Account settings
scroll down to website payments on left menu
choose Update next to Instant Payment Notifications
in the middle of the first line of text, hit the link IPN History page
This shows you a list of IPNs, defaulting to the last 24 hours - change the period if necessary and select one to resend