Sahih Muslim 564
Sahih Muslim · Book 5: The Book of Mosques and Places of Prayer · 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
Ibn Juraij has narrated it with the same chain of transmitters:
وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ ، أَخْبَرَنَا مُحَمَّدُ بْنُ بَكْرٍ ، ح قَالَ وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ ، قَالاَ جَمِيعًا أَخْبَرَنَا ابْنُ جُرَيْجٍ ، بِهَذَا الإِسْنَادِ " مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ - يُرِيدُ الثُّومَ - فَلاَ يَغْشَنَا فِي مَسْجِدِنَا " . وَلَمْ يَذْكُرِ الْبَصَلَ وَالْكُرَّاثَ .
He who eats of this plant, i. e. garlic, should not come to us in our mosque, and he made no mention of onions or leek.