Narrated Abu Huraira (may Allah be pleased with him):
The Prophet (ﷺ) said:
“ مَنْ لَمْ يَدَعْ قَوْلَ الزُّورِ وَالْعَمَلَ بِهِ وَالْجَهْلَ فَلَيْسَ لِلَّهِ حَاجَةٌ أَنْ يَدَعَ طَعَامَهُ وَشَرَابَهُ”
“Whoever does not give up false statements (i.e. telling lies), and evil deeds, and speaking bad words to others, Allah is not in need of his (fasting) leaving his food and drink.”
Sahih al-Bukhari 6057
Effect of sins on fasting
Undoubtedly sins such as lying, deceiving , swearing , insulting others etc., detract from the reward of the one who is fasting, because the Prophet (peace and blessings of Allah be upon him) said: “Whoever does not give up false speech and acting upon it and ignorant conduct, Allah has no need of his giving up his food and drink.” (Narrated by al-Bukhari, 6057)
It was narrated by al-Tabarani in al-Mu’jam al-Saghir and al-Mu’jam al-Awsat with the wording: “Whoever does not give up obscene talk and lying, Allah has no need of his giving up his food and drink.” (Classed as hasan by al-Albani in Sahih al-Targhib wa’l-Tarhib)
False speech has also been interpreted as referring to lying. This points to the abhorrence of lying when fasting, and shows that he is exposing his fast to rejection and lack of acceptance.
It says in al-‘Awn al-Ma’bud:
“If he does not give up” means, if he does not refrain from. “False speech” means lying. “Allah has no need” – Ibn Battal said: This does not mean that he is enjoined to stop fasting, rather what it means is a warning against false speech and the other things mentioned. … Ibn al-Munir said: Rather it is an indication that it will not be accepted. Ibn al-‘Arabi said: What this hadith means is that he will not be rewarded for his fasting … This hadith was quoted as evidence to show that these actions detract from the reward of fasting.”