عَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ قَالَ: ((مَنْ أَكَلَ مِنْ هَٰذِهِ الشَّجَرَةِ فَلَا يَأْتِيَنَّ الْمَسَاجِدَ))
It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: Whoever eats this plant (onion or garlic), let him not come to the houses of Allah (i.e., the mosques).