added missing braces {} on foreach and if
Merge pull request #5550 from samsonasik/add/braces

added missing braces {} on foreach and if