Hadithcore
Mishkat al-Masabih, 1648

He reported God’s messenger as saying, “When you see a funeral stand up; but anyone who follows it must not sit down till the bier is placed on the ground.” (Bukhari and Muslim.)

وَعَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِذَا رَأَيْتُمُ الْجَنَازَةَ فَقُومُوا فَمَنْ تَبِعَهَا فَلَا يَقْعُدْ حَتَّى تُوضَعَ»

References1 variant
In-Book Reference
Book 5, Hadith 123