كتاب المنثورات والملح
19
The Book of Miscellaneous ahadith of Significant Values
Abu Hurairah (May Allah be pleased with him) said:
The Messenger of Allah (ﷺ) said: "A man (from amongst the people before you) said: 'Indeed! I will give in charity.' So he took his Sadaqah out and placed it in a thief's hand. In the morning the people were talking (about this incident) and saying: 'Sadaqah was given to a thief last night.' The man said: 'O Allah! Praise be to You. I have given Sadaqah to a thief. Indeed, I will give in charity!' So he took his Sadaqah out and he placed it in a prostitute's hand. In the morning the people were talking (about this incident) and saying: 'Sadaqah was given to a prostitute last night.' On hearing this, the man said: 'Praise be to You, O Allah! I gave Sadaqah to a prostitute. Indeed, I will give in charity!' So he took his Sadaqah out and placed it in a rich man's hand. In the morning the people were talking (about this incident) and saying: 'Sadaqah was given to a rich man last night.' The man said: 'O Allah! Praise be to You (for helping me) give charity to a thief, a prostitute and a rich man.' Then he had a dream in which he was told that his Sadaqah to the thief might result in his refraining from his theft, his Sadaqah to the prostitute might help her abstain from her immorality, and his Sadaqah to the rich man might help him pay heed and spend from what Allah had bestowed upon him."

[Al- Bukhari].

وعن أبي هريرة رضي الله عنه أن رسول الله صلى الله عليه وسلم قال‏:‏ ‏ "‏ قال رجل لأتصدقن بصدقة، فخرج بصدقته، فوضعها في يد سارق، فأصبحوا يتحدثون‏:‏ تصدق على سارق‏!‏ فقال‏:‏ اللهم لك الحمد لأتصدقن بصدقة، فخرج بصدقته، فوضعها في يد زانية‏؟‏‏!‏ فأصبحوا يتحدثون‏:‏ تصدق على زانية فقال‏:‏ اللهم لك الحمد على زانية، لأتصدقن بصدقة، فخرج بصدقته، فوضعها في يد غني‏,‏ فأصبحوا يتحدثون‏!‏ تصدق الليلة على غني‏,‏ فقال‏:‏ اللهم لك الحمد على سارق ، وعلى زانية، وعلى غني‏!‏ فأتى فقيل له‏:‏ أما صدقتك على سارق، فلعله أن يستعف عن سرقته، وأما الزانية فلعلها تستعف عن زناها، وأما الغني فلعله أن يعتبر، فينفق مما آتاه الله‏"‏ ‏(‏‏(‏رواه البخاري بلفظه، ومسلم بمعناه‏)‏‏)‏‏.‏
Sunnah.com reference : Book 19, Hadith 58
Arabic/English book reference : Book 19, Hadith 1865