Yes, there's a rule for flat stages with expected sprint finishes that, if a crash occurs within 3 km of the finish line, then everyone who was in the front bunch at that point will be given the same finishing time. That's what happened today ... EXCEPT for the time bonuses.
In some (but not all) races, the organizers give "bonus seconds", or "bonifications", to the first few riders to finish the stage. Today, for example, the winner was given 10 bonus seconds, the second place finisher 6 seconds, and the third place finisher 4 seconds.
These bonus seconds may only be given for some stages. In this year's Tour, I believe that they may not be given for some of the big mountain stages, for example.
Back in the OLD days, the bonus times could be more than a few seconds: minutes, or even hours. Back then, the separation between the first few riders at the end of the race could be many hours; these days, it is typically 1-5 minutes.