Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:564d[Chain 1] Isḥāq b. Ibrāhīm > Muḥammad b. Bakr [Chain 2] Muḥammad b. Rāfiʿ > ʿAbd al-Razzāq > Jamīʿ

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.  

مسلم:٥٦٤dوَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ أَخْبَرَنَا مُحَمَّدُ بْنُ بَكْرٍ ح قَالَ وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ حَدَّثَنَا عَبْدُ الرَّزَّاقِ قَالاَ جَمِيعًا

أَخْبَرَنَا ابْنُ جُرَيْجٍ بِهَذَا الإِسْنَادِ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ يُرِيدُ الثُّومَ فَلاَ يَغْشَنَا فِي مَسْجِدِنَا وَلَمْ يَذْكُرِ الْبَصَلَ وَالْكُرَّاثَ