Fixes: #2139 Check foreach code
Fixes: #2140 the template don't escape the html inside itself