وعن أَبي هريرة - رضي الله عنه - أنَّ رَسُول اللهِ - صلى الله عليه وسلم - قَالَ: «قَالَ رَجُلٌ لأَتَصَدَّقَنَّ بِصَدَقَةٍ، فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدِ سَارِقٍ، فَأَصْبَحُوا يَتَحَدَّثُونَ: تُصُدِّقَ عَلَى سَارِقٍ! فَقَالَ: اللَّهُمَّ لَكَ الحَمْدُ لأتَصَدَّقَنَّ بِصَدَقَةٍ، فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا في يَدِ زَانِيَةٍ؛ فَأصْبَحُوا يَتَحَدَّثُونَ: تُصُدِّقَ اللَّيْلَةَ عَلَى زَانِيَةٍ! فَقَالَ: اللَّهُمَّ لَكَ الحَمْدُ عَلَى زَانِيَةٍ! لأتَصَدَّقَنَّ بِصَدَقَةٍ، فَخَرَجَ بِصَدَقَتِهِ فوَضَعَهَا في يَدِ غَنِيٍّ، فَأَصْبَحُوا يَتَحَدَّثُونَ: تُصُدِّقَ عَلَى غَنِيٍّ؟ فَقَالَ: اللَّهُمَّ لَكَ الحَمْدُ عَلَى سَارِقٍ وَعَلَى زَانِيَةٍ وعلى غَنِيٍّ! فَأُتِيَ فقيل لَهُ: أمَّا صَدَقَتُكَ عَلَى سَارقٍ فَلَعَلَّهُ أَنْ يَسْتَعِفَّ عَنْ سَرِقَتِهِ، وأمَّا الزَّانِيَةُ فَلَعَلَّهَا تَسْتَعِفُّ عَنْ زِنَاهَا، وأمَّا الغَنِيُّ فَلَعَلَّهُ أَنْ يَعْتَبِرَ فَيُنْفِقَ مِمَّا أَعْطَاهُ اللهُ». رواه البخاري بلفظه ومسلم بمعناه.
It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "A man said: I will certainly give some charity. So he went out with his charity and placed it in the hand of a thief. In the morning the people began talking: Charity was given to a thief! He said: O Allah, to You belongs all praise; I will certainly give charity (again). So he went out with his charity and placed it in the hand of an adulteress. In the morning the people began talking: Last night charity was given to an adulteress! He said: O Allah, to You belongs all praise, (even) for an adulteress! I will certainly give charity (again). So he went out with his charity and placed it in the hand of a rich man. In the morning the people began talking: Charity was given to a rich man! He said: O Allah, to You belongs all praise, for a thief, for an adulteress and for a rich man! Then (an angel) came to him (in a dream), and it was said to him: As for your charity to the thief, perhaps he will refrain from his stealing; as for the adulteress, perhaps she will refrain from her adultery; and as for the rich man, perhaps he will take a lesson and spend from what Allah has given him."
(Narrated by al-Bukhari with its wording and by Muslim with its meaning)