The Messenger of Allah ﷺ forbade these two foul plants and said, "Whoever eats them must not come near our mosque." He also said, "If you must eat them, kill their odor by cooking them well." The narrator explained that he meant onions and garlic.
قال حدثنا عبد الملك بن عمرو قال حدثنا خالد بن ميسرة حدثنا
نهى رسول الله ﷺ عن هاتين الشجرتين الخبيثتين وقال من أكلهما فلا يقربن مسجدنا وقال إن كنتم لا بد آكليهما فأميتموهما طبخا قال يعني البصل والثوم