A menstruating woman, a donkey and a black dog invalidate the prayer
It is narrated from Abu Dharr (may Allah be pleased with him) that the Messenger of Allah ﷺ said: يقطع صلاة المرء المسلم – إذا لم يكن بين يديه مثل مؤخرة الرحل ـ المرأة والحمار والكلب الأسود “The prayer of a Muslim man is broken by a woman, a donkey and a black dog, when there is not in front of him something like the back of a saddle as a sutra (barrier).”
In a narration from Ibn Abbas (may Allah be pleased with them both), the words are: المرأة الحائض “a menstruating woman”.
This same position is also reported from Abu Hurayrah (may Allah be pleased with him), Anas (may Allah be pleased with him), Ibn Abbas (may Allah be pleased with them both), Abu Dharr (may Allah be pleased with him), Imam Hasan al-Basri (may Allah have mercy on him), Imam Abu al-Ahwas (may Allah have mercy on him) and Imam Ibn Hazm (may Allah have mercy on him).
(Ahmad, may Allah have mercy on him): A black dog breaks the prayer, but regarding the woman and the donkey I have a difficulty.
(The majority, Shafi’i, Malik, Abu Hanifah, may Allah have mercy on them): None of these things invalidates the prayer, though a deficiency occurs in its reward.
The majority of scholars use the following hadith as evidence:
It is narrated from Abu Sa’id al-Khudri (may Allah be pleased with him) that the Messenger of Allah ﷺ said: لا يقطع الصلاة شئ وادرؤوا ما استطعتم “Nothing breaks the prayer, but try to repel whoever passes in front of you as far as you are able.”
(Shawkani, may Allah have mercy on him): A menstruating woman and a black dog break the prayer.
(The preferred view): These three things break the prayer, as the previously mentioned sahih (authentic) hadith of Abu Dharr (may Allah be pleased with him) is evidence for it.
(Ibn Taymiyyah, may Allah have mercy on him): He holds this view.
(Ibn al-Qayyim, may Allah have mercy on him): He gives preference to it.
(Ibn Baz, may Allah have mercy on him): These three things break a person’s prayer.