Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "The whole earth is a mosque except the graveyard and the bathhouse."
The hadith of al-Thawri is mursal; it has also been narrated with a connected chain, but that is of no worth. The hadith of Hammad bin Salamah is connected (mawsul), and Abd al-Wahid bin Ziyad and al-Darawardi corroborated him in narrating it as connected.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4272