The Messenger of Allah ﷺ said, "Whoever enters this mosque and needs to spit or clear phlegm should dig a hole and bury it. If he cannot do that, let him spit into his garment and then take it outside."
حدثنا القعنبي حدثنا أبو مودود عن عبد الرحمن بن أبي حدرد الأسلمي سمعت
قال رسول الله ﷺ من دخل هذا المسجد فبزق فيه أو تنخم فليحفر فليدفنه فإن لم يفعل فليبزق في ثوبه ثم ليخرج به