مِشْكَاةُ الْمَصَابِيحِ
Mishkat al-Masabih 339
Purification
How to act when relieving oneself - Section 1
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: اتَّقُوا اللَّاعِنَيْنِ. قَالُوا: وَمَا اللَّاعِنَانِ يَا رَسُولَ اللَّهِ؟ . قَالَ: «الَّذِي يَتَخَلَّى فِي طَرِيقِ النَّاس أَو فِي ظلهم» . رَوَاهُ مُسلم
Abu Huraira reported God's messenger as saying, "Guard against the two things which produce cursing.” He was asked what they were and said, "Relieving oneself where people walk, or where they sit in the shade.” Muslim transmitted it.
Mishkat al-Masabih, 339صَحِيحٌ (الألباني)