Such objects should be clean of physical impurities as much as possible. If one can not remove them, he may pray with the impurities present and does not have to repeat the prayer later. Concerning bodily purity, Anas related that the Prophet upon whom be peace, said, “Stay clean of urine, as the majority of punishment in the grave is due to it.” This is related by ad-Daraqutni, who said it is hassan.
Reported ‘Ali, I used to have a great deal of prostatic fluid flowing, so I asked a man to ask the Prophet about it (as I was shy to ask him, due to my relationship with him through his daughter). He asked him and the Prophet, upon whom be peace, said, “Make ablution and wash your penis.” (Related by al-Bukhari and others.)
‘Aishah also related that the Messenger of Allah said to women with a prolonged flow of blood, “Wash the blood from yourself and pray. “
Concerning purity of clothing, we have the following: Says Allah, “And purify your raiment” (al-Muddathir 4). Jabir ibn Sumrah reported that he heard a man ask the Prophet, “May I pray in the same clothes that I had on during intercourse with my wife?” He said, “Yes, but if you see some stains on it, you must wash it.” This hadith is related by Ahmad and Ibn Majah. Its narrators are trustworthy. Reported Mu’awiyyah, “I asked Umm Habibah, ‘Did the Prophet pray in the same clothes that he wore when he had intercourse?’ She said, ‘Yes, if there were no stains on it.”‘(Related by Ahmad, Abu Dawud, an-Nasa’i and Ibn Majah.) Abu Sa’eed reported that the Prophet removed his shoes and the people behind him did likewise. When he finished the prayer, he asked, “Why did you remove your shoes?” They said, “We saw you remove yours.” He said, “Gabriel came to me and informed me that there was some filth on them. Therefore, when one of you comes to the mosque, he should turn his shoes over and examine them. If one finds any dirt on them, he should rub them against the ground and pray with them on.” The hadith is related by Ahmad, Abu Dawud, al-Hakim, Ibn Hibban and Ibn Khuzaimah. The latter grades it as sahih.
This hadith shows that if one enters the mosque (with his shoes on) and is unaware of some impurity or has forgotten it, and he suddenly remembers it during the prayer, he must try to remove it and proceed with the prayer. He does not have to repeat it later on.
Concerning the purity of the place where one is praying, Abu Hurairah said, “A bedouin stood and urinated in the mosque. The people got up to grab him. The Prophet said, ‘Leave him and pour a container full of water over his urine. You have been raised to be easy on the people, not to be hard on them.” (Related by “the group,” except for Muslim.)
Commenting on this subject, ash-Shaukani says, “If what has been produced of proof is firmly established, then one would know that it is obligatory to have one’s clothes free of impurities. Whoever prays and has impurities on his clothing has left one of the obligations of the prayer. But his prayer would not be voided.” In ar-Rauzhat an-Nabiyyah it states, “The majority of scholars are of the opinion that it is obligatory to purify three things: the body, the clothes, and the place of prayer. Some are of the opinion that this is a condition for the soundness of the prayer, and others say that it is just a sunnah. The truth of the matter is that it is obligatory. Whoever intentionally prays with impurities on his clothing has left one of the obligations (of the prayer), but the prayer is still valid.”