Hadithcore
Mishkat al-Masabih, 300

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.)

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «لَا تُقْبَلُ صَلَاةُ مَنْ أَحْدَثَ حَتَّى يتَوَضَّأ»

References1 variant
In-Book Reference
Book 3, Hadith 19