أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ قَالَ رَجُلٌ لأَتَصَدَّقَنَّ بِصَدَقَةٍ. فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدِ سَارِقٍ فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ عَلَى سَارِقٍ. فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ لأَتَصَدَّقَنَّ بِصَدَقَةٍ. فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدَىْ زَانِيَةٍ، فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ اللَّيْلَةَ عَلَى زَانِيَةٍ. فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ عَلَى زَانِيَةٍ، لأَتَصَدَّقَنَّ بِصَدَقَةٍ. فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدَىْ غَنِيٍّ فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ عَلَى غَنِيٍّ فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ، عَلَى سَارِقٍ وَعَلَى زَانِيَةٍ وَعَلَى غَنِيٍّ. فَأُتِيَ فَقِيلَ لَهُ أَمَّا صَدَقَتُكَ عَلَى سَارِقٍ فَلَعَلَّهُ أَنْ يَسْتَعِفَّ عَنْ سَرِقَتِهِ، وَأَمَّا الزَّانِيَةُ فَلَعَلَّهَا أَنْ تَسْتَعِفَّ عَنْ زِنَاهَا، وَأَمَّا الْغَنِيُّ فَلَعَلَّهُ يَعْتَبِرُ فَيُنْفِقُ مِمَّا أَعْطَاهُ اللَّهُ .
Allah's Messenger (ﷺ) (p.b.u.h) said, "A man said that he would give something in charity. He went out withhis object of charity and unknowingly gave it to a thief. Next morning the people said that he hadgiven his object of charity to a thief. (On hearing that) he said, "O Allah! All the praises are for you. Iwill give alms again." And so he again went out with his alms and (unknowingly) gave it to anadulteress. Next morning the people said that he had given his alms to an adulteress last night. Theman said, "O Allah! All the praises are for you. (I gave my alms) to an adulteress. I will give almsagain." So he went out with his alms again and (unknowingly) gave it to a rich person. (The people)next morning said that he had given his alms to a wealthy person. He said, "O Allah! All the praisesare for you. (I had given alms) to a thief, to an adulteress and to a wealthy man." Then someone cameand said to him, "The alms which you gave to the thief, might make him abstain from stealing, andthat given to the adulteress might make her abstain from illegal sexual intercourse (adultery), and thatgiven to the wealthy man might make him take a lesson from it and spend his wealth which Allah hasgiven him, in Allah's cause."