I found this bug in my code to day. It happens when I have ‘ or ” or / or \ in my input fields.

Use esc_attr() to escape all of those

Here is the fix…

[php]

add_post_meta(ID, “META_KEY”, esc_attr($_POST[first_name]), true);

[/php]