The first transmitter is Abū Hurayrah (may Allah be pleased with him),
and several routes go back to him:
1 – ʿAbd al-Razzāq ibn Hammām, from Maʿmar, from Hammām, who heard Abū Hurayrah (may Allah be pleased with him) relate it as a Prophetic report; the wording cited above is his. It was recorded by al-Bukhārī, Aḥmad, and al-Bayhaqī.
2 – Ibn Shihāb al-Zuhrī, from Ḥumayd ibn ʿAbd al-Raḥmān, that both Abū Hurayrah and Abū Saʿīd narrated: the Messenger of Allah ﷺ saw phlegm on the wall of the mosque, so he picked up a pebble and scraped it off, then said … He conveyed it with wording similar to the foregoing, and this chain contains the second parenthetical addition, whose wording is:
“When one of you expectorates, let him not spit in front of him nor to his right; rather he should spit to his left or beneath his left foot.”
This version was recorded by al-Bukhārī, Muslim, al-Dārimī, al-Bayhaqī, and Aḥmad. A joint narration comes from Abū Hurayrah and Abū Saʿīd; a single-transmitter version from Abū Hurayrah alone is reported by al-Ṭayālisī and likewise by al-Nasāʾī. It is the recension adopted by the two Shaykhs (al-Bukhārī and Muslim).
3 – Ismāʿīl ibn ʿUlayyah, from al-Qāsim ibn Mihrān, from Abū Rāfiʿ, from him, with wording similar to the above: it includes the first parenthetical addition, and ends with wording akin to what is found in the third narration, namely: