I was reading through the LOTG trying to see what trick they had up the sleeve and of course it look like they do for this.
In Law 3: 9. Goal with an extra player on the field of play
If, after a goal is scored, the referee realises, before play restarts, that an extra person was on the field...