[Machine] The Messenger of Allah ﷺ said, "The whole earth is a mosque except for the graveyard and the bathroom." It was asked to Abu Muhammad, "Is prayer allowed in the graveyard?" He said, "Yes, if it is not on the grave." And the narration says that most of them transmitted it.
قَالَ رَسُولُ اللَّهِ ﷺ «الْأَرْضُ كُلُّهَا مَسْجِدٌ إِلَّا الْمَقْبَرَةَ وَالْحَمَّامَ» قِيلَ لِأَبِي مُحَمَّدٍ تُجْزِئُ الصَّلَاةُ فِي الْمَقْبَرَةِ؟ قَالَ إِذَا لَمْ تَكُنْ عَلَى الْقَبْرِ فَنَعَمْ وَقَالَ الْحَدِيثُ أَكْثَرُهُمْ أَرْسَلُوهُ