We are beginning siman 33. The Chayei Adam writes that if one davens and then realizes they davened in the presence of tzoah, if it was a place where one should have anticipated such a possibility, and they should have checked the area before davening, we apply the concept of zevach reshaim toeivah. The halacha is that if someone offers a korban while acting improperly, the korban is not accepted. Instead of being an act which brings one close to Hashem, it is a toeivah. Since tefillah acts as the replacement for korbanos, a person is not yotzei tefillah. Similarly, one repeats kriyas shema (without the brachos), especially because the shema itself has no brachos.
However, the Chayei Adam has a question regarding brachos. Brachos do not come to replace a korban, so arguably the concept of zevach reshaim toeivah does not apply to them. On the other hand, since one acted improperly, maybe they are not yotzei. It becomes a safeik brachos, and the Chayei Adam paskens one should not repeat any brachos recited in the presence of tzoah.
The Piskei Mishnah Berurah points out that the Mishnah Berurah paskens that one must repeat birchas hamazon. Although it is set up in the form of a bracha, since it is a chiyuv deoraysa, one must repeat it.
The Chayei Adam continues, and points out that since mei raglayim are derabanan, one will never need to repeat if they davened in the presence of mei raglayim.
If a person has no reason to believe there would be tzoah in the place they are davening, they are yotzei shema or shemoneh esrei, and do not need to repeat anything.
We need to understand how to apply these halachos to our modern homes. The Gemara says that one does not need to be concerned for tzoah in a home, because a home was not a place where people relieved themselves. On the other hand, one does need to be concerned for tzoah in an ashpah. Nowadays, we do not have tzoah in our ashpahs, and, although we generally are not concerned for tzoah in a home, we may need to be concerned for diapers. We will discuss this further, be’ezras Hashem.
The Chayei Adam ends the siman by writing that in any place where the halacha is one cannot recite torah or tefillah, if one did daven there, they should repeat kriyas shema. However, regarding shemoneh esrei, one only repeats shemoneh esrei if the reason one cannot daven there is due to an issur deorasya. Regarding other brachos, one does not repeat the bracha even if the reason one cannot daven there is due to an issur deoraysa.
The Piskei Mishnah Berurah points out that the Mishnah Berurah holds one should always repeat shemoneh esrei, but has a safeik in the Biur Halacha. We will clarify these points in the next shiurim, be’ezras Hashem.
Summary
If one davened in a place with tzoah, or in any place where it is assur mideoraysa to daven:
If they should have expected tzoah in that place, and they were negligent in checking, they must repeat kriyas shema (without brachos), shemoneh esrei and birchas hamazon..
If they had no reason to suspect tzoah in that place, they do not need to repeat anything.
One does not need to repeat anything if they davened in a place with mei raglayim, or any other place where it is assur miderabanan to daven..