The Messenger of Allah ﷺ said, "A person's fast is not broken by vomiting, by a wet dream, or by cupping."
حدثنا محمد بن كثير أخبرنا سفيان عن زيد بن أسلم عن رجل من أصحابه
قال رسول الله ﷺ لا يفطر من قاء ولا من احتلم ولا من احتجم
No references are available.
[Its chain of transmission is daif]. Bayhaqi (4/220) reported it from the hadith of Abu Dawud with this chain. A man among the companions of Zayd bin Aslam whom I could not identify. It has daif corroborating narrations in Daraqutni (1/183, no. 2237).