“I’ve heard that it’s permissible to pray the Salah even in a bathroom if one cannot pray elsewhere and the time of the next prayer is near, on the condition of not staying near the proper toilet; is that correct?”.
Answer:
In the name of Allah, the most Beneficent, the most Merciful.
Saaiduna Abu Saidul Khudri narrates that the Prophet of Allah said: “All the earth is a mosque except for graveyards and bathrooms.” (Sunan Tirmizi p.73 v.1)
It is considered disliked to read salah in bathrooms. The main reason for its detestability is that it is a place where there may be impurities, thus, causing doubts whether the place of salah is pure or not. (Tuhfatul Lami, Mufti Saeed Palanpuri (DB), p.172 v.2)
The conclusion we can come to is that if the place where you prayed the salah in the bathroom was in fact impure, your salah will not be accepted as one of the conditions for salah to be valid is that the place has to be pure. (Hidayah p.71 v.1) If however, the place was pure then the salah prayed in the bathroom will be disliked for the reason cited above.
Only Allah Knows Best
Mohammed Tosir Miah
Darul Ifta Birmingham