It's really easy to spot on sites using child themes. They put the same code in all theme files, and because of the child/parent relationship, you get the "cannot redeclare" error - cuz the function is in there twice. ;)

Note this is not a theme vulnerability, rather a server side one (or possibly plugins). Basically they find a way to be able to edit your files - no matter what files they are.