Mishkat al-Masabih
Abu Huraira reported God's messenger as saying, “The prayer of one who has voided excrement will not be accepted until he performs ablution.” (Bukhari and Muslim.)
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «لَا تُقْبَلُ صَلَاةُ مَنْ أَحْدَثَ حَتَّى يتَوَضَّأ»
Reference