Sayyiduna Anas (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "Beware of these two foul-smelling vegetables, lest you eat them and then enter our mosques. If you must eat them, then kill them (that is, their smell) with fire."
Al-Tabarani recorded it in al-Mu'jam al-Awsat, and its narrators have been declared trustworthy.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1994