Fall foul of something

Meaning: To get into trouble by failing to follow a rule, law or requirement.

Example: The company fell foul of advertising regulations.