Hadithcore
Sahih Muslim, 1031 b
sahih

This hadith has been narrated, on the authority, of Abu Huraira (with this change of words)." A person whose heart is attached to the mosque when he goes out of it till he returns to it."

وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ خُبَيْبِ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ حَفْصِ بْنِ عَاصِمٍ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، - أَوْ عَنْ أَبِي هُرَيْرَةَ، - أَنَّهُ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏.‏ بِمِثْلِ حَدِيثِ عُبَيْدِ اللَّهِ ‏.‏ وَقَالَ ‏

‏ وَرَجُلٌ مُعَلَّقٌ بِالْمَسْجِدِ إِذَا خَرَجَ مِنْهُ حَتَّى يَعُودَ إِلَيْهِ ‏

‏ ‏.‏

References2 variants
In-Book Reference
Book 12, Hadith 118
USC-MSA web (English) reference
Book 5, Hadith 2249 (deprecated numbering scheme)