I heard Jabir bin ʿAbdullah saying, "The Prophet ﷺ said, 'Whoever eats (from) this plant (he meant garlic) should keep away from our mosque." I said, "What does he mean by that?" He replied, "I think he means only raw garlic."
النَّبِيُّ ﷺ مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ يُرِيدُ الثُّومَ فَلاَ يَغْشَانَا فِي مَسَاجِدِنَا قُلْتُ مَا يَعْنِي بِهِ قَالَ مَا أُرَاهُ يَعْنِي إِلاَّ نِيئَهُ وَقَالَ مَخْلَدُ بْنُ يَزِيدَ عَنِ ابْنِ جُرَيْجٍ إِلاَّ نَتْنَهُ