Chapter: The prohibition on anyone who has eaten garlic, onion, leek, or any other food with an offensive odor from entering the mosque until the smell has disappeared, except in cases of necessity.
1701 – Ibn ʿUmar, may Allah be pleased with him, reported that the Prophet ﷺ said, “Whoever eats from this tree”—meaning garlic—“let him not come near our mosque.” Agreed upon. Muslim’s wording is: “our mosques.”
1702 – Anas, may Allah be pleased with him, said that the Prophet ﷺ declared, “Whoever eats from this tree, let him not approach us or pray with us.” Agreed upon.
1703 – Jabir, may Allah be pleased with him, related that the Prophet ﷺ said, “Whoever has eaten garlic or onion should keep away from us, or keep away from our mosque.” Agreed upon. In another wording recorded by Muslim: “Whoever eats onion, garlic, or leek should not approach our mosque, for the angels are offended by the same things that offend the children of Adam.”