Praise be to Allah.
We ask Allaah to heal our sister, and may Allaah reward her with good for her keenness to understand the rulings of her religion and her not being shy to do so, so that she may clearly understand her religion.
A person who is praying may sometimes imagine that he has passed wind whilst praying, when that has not in fact happened. This may be due to the whispering of the Shaytaan who wants to spoil his prayer and make him not focus with proper humility in it. The worshipper should not stop praying unless he is certain that something has come out of him.
It was narrated from ‘Abbaad ibn Tameem that his paternal uncle asked the Messenger of Allaah (peace and blessings of Allaah be upon him) about a man who thought he felt something whilst praying. He said: “He should not stop praying unless he hears a sound or detects an odour.”
Narrated by al-Bukhaari, 137 (this version was narrated by him); Muslim 362.
What is meant by the hadeeth is not that the ruling depends on hearing a sound or detecting an odour, rather what is meant is being certain that something has come out even if one does not hear a sound or detect an odour.
See Sharh Muslim by al-Nawawi, 4/49
The basic principle concerning the worshipper is that if he has done wudoo’, then his wudoo’ cannot be broken by something doubtful, rather he must be certain that he has broken it. If he is certain that he has broken his wudoo’, then he should stop praying and do wudoo’ again.
What breaks or invalidates wudoo’ can only be that which comes out of the front of back passage for certain, so that one is sure of it and not doubtful or confused. Simply feeling that there is gas in one’s stomach is not one of the things that invalidate wudoo’, unless something comes out.
The ruling on the gas of which you complain is the same as the rulings for those who suffer from istihaadah (non-menstrual vaginal bleeding) or urinary incontinence.
(al-Sharh al-Mumti’, 1/437)
Two scenarios may apply:
The first is:
There may be a time when it stops, such as if you pass wind, then it stops for a while, during which time you can do wudoo’ and pray, then it starts again. In this case you have to do wudoo’ and pray during the time when it stops.
The second is:
It may be continuous and there may be no time when it stops; it could happen all the time. In this case you should do wudoo; for each prayer after the time for the prayer begins, and pray with this wudoo’; it does not matter whatever comes out of you even if that happens during wudoo’ or during the prayer.
Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) said:
Whoever cannot keep his wudoo’ for the duration of the prayer should do wudoo’ and pray, and it does not matter what comes out of him during the prayer, and his wudoo’ is not invalidated by that, according to the consensus of the imams. The most he has to do is to do wudoo’ for each prayer.
Majmoo’ al-Fataawa, 21/221
The Standing Committee was asked about a man who suffers from urinary incontinence that appears for a short while after he urinates; if he waits for the urine to stop, the prayer in congregation will be over. What is the ruling?
The Committee replied:
If he knows that the incontinence will stop, it is not permissible for him to pray in this condition seeking the virtue of the jamaa’ah. Rather he has to wait until it stops, then he should cleanse himself with water (istinja’) and pray, even if he has missed the prayer in congregation. He should hasten to cleanse himself with water and do wudoo’ after the time for prayer begins, hoping that he will be able to offer the prayer in congregation.
It also says in Fataawa al-Lajnah al-Daa’imah:
The basic principle concerning emission of wind is that it invalidates wudoo’, but if a person passes wind continually, he has to do wudoo’ for each prayer when he wants to pray, then if wind comes out of him whilst he is praying, that does not invalidate it; he has to continue with his prayer until he completes it. This is a dispensation granted by Allaah to make things easier for His slaves and not to cause them any hardship, as Allaah says (interpretation of the meaning):
“Allaah intends for you ease”
“and has not laid upon you in religion any hardship”
al-Lajnah al-Daa’imah li’l-Buhooth, 5/411
With regard to your going to the mosque with this smell, that is not permissible because the mosques must be protected from all offensive odours, because that disturbs the worshippers, and it offends the noble angels.
The Prophet (peace and blessings of Allaah be upon him) forbade those who eat garlic or onions to come near the mosques. Al-Bukhaari and Muslim narrated from Jaabir ibn ‘Abd-Allaah that the Prophet (peace and blessings of Allaah be upon him) said: “Whoever eats garlic or onions, let him keep away from us (or he said: let him keep away from our mosque) and sit in his house.”
And Muslim (564) narrated that the Prophet (peace and blessings of Allaah be upon him) said: “Whoever eats onions and garlic and leeks, let him not come near our mosque, for the angels are offended by that which offends the son of Adam.”
The Prophet (peace and blessings of Allaah be upon him) used to command that anyone on whom he detected the odour of garlic and onions be asked to leave the mosque.
Muslim (567) narrated that ‘Umar ibn al-Khattaab said: I saw the Messenger of Allaah (peace and blessings of Allaah be upon him), if he detected the smell (of onions or garlic) on a man in the mosque, he would order that he be taken out to al-Baqee’ (the cemetery in al-Madeenah).
And Allaah knows best.