Then it was also transmitted by ʿAlī ibn Mus-hir, through Hishām, with a similar wording.
Ibn Khuzaymah likewise reported the ḥadith, as cited in Fatḥ al-Bārī. Ibn Baṭṭāl said:
“It shows that whoever has no house or place to pass the night is allowed to sleep in the mosque—man or woman—provided there is no fear of temptation. It also establishes the permissibility of erecting a small tent or the like inside the mosque for a destitute person, whether male or female.” This statement is quoted in al-ʿUmda.
I say: the first two reports testify to this ruling as well, specifically in regard to men. As for turning an entire mosque into a dwelling out of necessity—as has happened in our own days when about 70,000 Palestinians migrated to Syria fleeing the atrocities of the Jews, and the government housed some of them in numerous mosques—I consider it permissible on condition that it does not lead to the suspension of congregational prayer; that is, where mosques are plentiful, the refugees may lodge in some whose closure to regular worshippers would not cause the disruption just mentioned. Allah, the Exalted, knows best.
30 – Distribution of Wealth: the ḥadith states that wealth was brought to the Prophet ﷺ from Bahrain (in another version, al-ʿAlāʾ ibn al-Ḥaḍramī sent the Messenger of Allah ﷺ eighty thousand [dirhams] from Bahrain). He said, “Spread it out in the mosque.” It was the largest sum ever brought to the Messenger of Allah ﷺ. (Another narration adds: he ordered that it be laid out on a mat, and the call to prayer was announced.) The Messenger of Allah ﷺ came out for the prayer and did not so much as glance at it; when he had finished, he returned and sat beside it. [People came when they saw the money, and in those days there was neither counting nor weighing—each person simply took whatever …]