Yosef Karo, Yoreh Deah — Orach Chaim 108
“ But if it was closed on all sides, like the way that we bury hot food for Shabbat purposes, it is forbidden. And even post facto, some are strict and forbid it if the permitted food and the forbidden food are uncovered. But in a situation where there would be great loss, we can be lenient. ”
