Skip to content

Instantly share code, notes, and snippets.

@Moketronics
Created February 8, 2012 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moketronics/1773912 to your computer and use it in GitHub Desktop.
Save Moketronics/1773912 to your computer and use it in GitHub Desktop.
JS field clearing issue PHP side fix
if (stripos($_POST['first_name'], 'first name...') !== false) {
$first_name = str_ireplace('first name...', '', $_POST['first_name']);
$first_name = sanitize_user( $first_name, true );
} else {
$first_name = sanitize_user( $_POST['first_name'], true );
}
if (stripos($_POST['last_name'], 'last name...') !== false) {
$last_name = str_ireplace('last name...', '', $_POST['last_name']);
$last_name = sanitize_user( $last_name );
} else {
$last_name = sanitize_user( $_POST['last_name'] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment