The Messenger of Allah ﷺ said, "When one of you spits in the mosque, let him not spit to his right, but rather to his left or beneath his foot."
قال رسول الله ﷺ: إذا بصق أحدكم في المسجد فلا يبصق عن يمينه، ولكن عن يساره، أو تحت قدمه.
Bazzar related it - Kashf Astar (411) - from Yusuf bin Musa, who said, Jareer bin Abdul-Hameed told us, from Shaybani, from Adi bin Thabit, from Zirr, from Huzaifa, and he mentioned it. Its chain is sahih. Haythami said in Majma (18/1), Bazzar related it and its narrators are the narrators of the sahih.Ibn Khuzayma related it (925), and from him Ibn Hibban (1639), from Yusuf bin Musa with his chain, with the wording, "Whoever spits toward the qibla will come on the Day of Resurrection with his spit between his eyes."But Abu Dawud related it (3824) from Uthman bin Abu Shayba, who said, Jareer told us, from Shaybani, from Adi bin Thabit, from Zirr bin Hubaysh, from Huzaifa, "I think from the Messenger of Allah ﷺ," who said, "Whoever spits toward the qibla will come on the Day of Resurrection with his spit between his eyes, and whoever eats from this foul plant should not come near our mosque," three times.This is how Uthman bin Abu Shayba related it from Jareer, with doubt as to whether it goes back to the Prophet. Ibn Abu Shayba related it (7534) from Ali bin Mushir, from Shaybani with his chain, but did not attribute it to the Prophet.The version that attributes it to the Prophet is more deserving of acceptance, because something like this would not be said merely as personal opinion. Jareer bin Abdul-Hameed bin Qurt is trustworthy, except that toward the end of his life he began to make mistakes. So what he related with certainty is more deserving of acceptance than what he related with doubt.