Praise be to Allah.
If the amalgam of the filling is mixed with oil of cloves to soothe the nerve, then this does not invalidate the fast, even if you notice the taste of cloves, because nothing leaches out of the filling, or it is a very small amount that mixes with the saliva and cannot be expelled, so it is overlooked, as any water that is left over after rinsing one’s mouth when doing Wudu and mixes with the saliva and reaches the stomach is also overlooked, and as any remaining taste of the Siwak in the mouth is also overlooked.
“Doctors have stated that the Siwak contains eight chemical substances that protect the teeth and gums from disease, and they dissolve in the saliva and enter the pharynx.
It is narrated in Al-Bukhari from `Amir ibn Rabi`ah (may Allah be pleased with him): I saw the Messenger of Allah (blessings and peace of Allah be upon him) cleaning his teeth with the Siwak while he was fasting more times than I can count.
Any such substance that enters the stomach is overlooked, because it is a small amount and is not ingested deliberately.” (Muftirat As-Siyam Al-Mu`ashirah, p. 33, by Dr. Ahmad Al-Khalil; Al-Muftirat At-Tibbiyyah Al-Mu`asirah, p. 165, by Dr. `Abd Ar-Razzaq Al-Kindi)
If this substance is overlooked because it is a small amount and is not ingested deliberately, then the traces of cloves are also overlooked, if we assume that anything leaches from the filling.
For more details, please see the following answers: 49658, 92923, and 78438 .
And Allah knows best.
Comment