Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions. Wa alaikum assalam wa rahmatullahi wa barakatuh. As to what follows: In response to your question, we say: This statement is not from the sayings of the Prophet (peace be upon him). It was mentioned by Shaykh ‘Ali Mula al-Qari in his book al-Masnoo’ fi Ma’rifat al-Hadith al-Mawdoo’ (p 92) with the wording, “Speaking in the mosque eats up good deeds in the way in which animals eat grass.” In Kashf al-Khafaa 1/423 the hadith was mentioned with this wording, then the author said, “The version that is popularly quoted by people is: “Permissible speech in the mosque eats up good deeds like fire consumes wood.”