Praise be to Allah.
This is permissible, and it need not be stopped, but a cloth or something should be put down, the mosque should be protected, and care should be taken not to drop any crumbs, pieces of fruit, etc., in the mosque. This is what we have stated with regard to foods that do not have an offensive odour, like garlic, onions and leeks, and dishes that do not have any of these odours in them.. If the food has any of these things in it, then it is makrooh to eat it in the mosque, and the person who has eaten them should be stopped from entering the mosque until the smell has gone. If he has entered the mosque, he should be thrown out, because of the well-known saheeh hadeeth to that effect. All of this applies where the odour is present, but if the odour has been killed by cooking, the person who has eaten it need not be stopped from entering the mosque, and it is permissible to eat it in the mosque. And Allaah knows best.