[Machine] The Messenger of Allah ﷺ said: "The entire earth is a mosque, except for the bathroom and graveyard." Some scholars argued against praying in graveyards with a confirmed hadith narrated by Ibn Umar, where the Prophet ﷺ said: "Make your houses your places of prayer and do not make them graves." There are also two confirmed hadiths, one narrated by Aisha and the other by Ibn Abbas, where the Prophet ﷺ cursed the Jews and Christians for taking the graves of their prophets as places of worship, warning against doing the same. These two hadiths are mentioned in their appropriate places, and we have also narrated from Abdullah ibn Amr ibn al-As that he disliked men praying in bathrooms.
قَالَ رَسُولُ اللهِ ﷺ الْأَرْضُ كُلُّهَا مَسْجِدٌ إِلَّا الْحَمَّامَ وَالْمَقْبَرَةَ وَاحْتَجَّ بَعْضُ أَهْلِ الْعِلْمِ فِي كَرَاهِيَةِ الصَّلَاةِ فِي الْمَقَابِرِ بِالْحَدِيثِ الثَّابِتِ عَنِ ابْنِ عُمَرَ قَالَ قَالَ رَسُولُ اللهِ ﷺ اجْعَلُوا مِنْ صَلَاتِكُمْ فِي بُيُوتِكُمْ وَلَا تَتَّخِذُوهَا قُبُورًا وَبِالْحَدِيثِ الثَّابِتِ عَنْ عَائِشَةَ وَابْنِ عَبَّاسٍ عَنِ النَّبِيِّ ﷺ لَعْنَةُ اللهِ عَلَى الْيَهُودِ وَالنَّصَارَى اتَّخَذُوا قُبُورَ أَنْبِيَائِهِمْ مَسَاجِدَ يُحَذِّرُ مِثْلَ مَا صَنَعُوهُ وَالْحَدِيثَانِ مُخَرَّجَانِ فِي مَوْضِعِهِمَا وَرُوِّينَا عَنْ عَبْدِ اللهِ بْنِ عَمْرِو بْنِ الْعَاصِ أَنَّهُ كَانَ يَكْرَهُ أَنْ يُصَلِّيَ الرَّجُلُ فِي الْحَمَّامِ