Hadithcore
Bulugh al-Maram, 91

Narrated Abu Huraira (rad):

Allah’s Messenger (ﷺ) said: “Safeguard yourselves from the two matters which cause accursing that befalls the one who relieves himself on people’s path-ways and under the shades.” [Reported by Muslim].

وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ اِتَّقُوا اَللَّاعِنِينَ: اَلَّذِي يَتَخَلَّى فِي طَرِيقِ اَلنَّاسِ, أَوْ فِي ظِلِّهِمْ } رَوَاهُ مُسْلِم ٌ [1]‏ .‏

References2 variants
In-Book Reference
Book 1, Hadith 109
English Reference
Book 1, Hadith 97