Talq b. ‘Ali* reported God’s Messenger as saying, “When any of you breaks wind during prayer, he must withdraw, perform ablution, and repeat the prayer.”
* This is a mistake in the text of the Mishkat. The name is ‘Ali b. Talq. Cf. Abu Dawud, Salat, 186.
Abu Dawud transmitted it, and Tirmidhi transmitted it with something added and something omitted.
‘Abdallah b. ‘Amr reported God’s Messenger as saying, “When one of you breaks wind when he has sat at the end of his prayer before giving the salutation, his prayer is valid.”
Tirmidhi transmitted it saying that this is a tradition whose isnad is not strong, and there is confusion about its isnad.
‘A’isha said, “When God’s Messenger was praying voluntary prayers with his door bolted I came and asked to have the door opened, and he went and opened it for me, then returned to his place of prayer.” She mentioned that the door faced the qibla.
Ahmad, Abu Dawud and Tirmidhi transmitted it, and Nasa’i transmitted something similar.