I cannot fix this issue since deleting some intermediate revisions will make the next author appear as the author of spam... See XWIKI-23708
I'm attaching the patch in case XWIKI-23708 is fixed one day.