The Messenger of Allah (ﷺ) said: He who eats of this (offensive) plant must not approach…

Sahih Muslim Book 5 Hadith 87

Sahih Muslim #561 b

The Book of Mosques and Places of Prayer 5:87

Ibn 'Umar reported:

The Messenger of Allah (ﷺ) said: He who eats of this (offensive) plant must not approach our mosque, till its odor dies: (plant signifies) garlic.

Chapter: Prohibiting one who has eaten garlic, onions, or leeks, and other things that have an offensive odor from coming to the masjid, until that smell has gone away, and such a person should be expelled from the masjid

Grade: Sahih