If a person intends to fast and confirms the intention (of fasting) during the night, then drinks or eats unintentionally, his fast is still valid according to the majority of scholars, and there is no penalty for him. This is because of the Prophet’s saying, peace be upon him: “Whoever forgets while fasting and eats or drinks, let him complete his fast, for it is Allah who has fed him and given him drink.” This Ḥadīth is narrated by both Al-Bukhāriy and Muslim. There is no difference between the obligatory and voluntary fasts in this regard.
Fatwa by Dr. Khālid Naṣr