$okToImport = true;
// Clean up member login to remove restricted characters
- $memberLogin = preg_replace('/[^a-zA-Z0-9_-]+/', '', $c['member_login']);
+ $memberLogin = sanitize_user( $c['member_login'], true );
if ($memberLogin != $c['member_login']) {
// Report that we're stripping illegal characters from the username
$this->wpdb->insert(
GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . 'contacts',
array(
- 'active' => true,
+ 'active' => true,
'primary_contact' => true,
- 'access' => $this->config['access_numb']['NotDisplayedModerated'],
- 'fname' => $c['primary_contact_fname'],
- 'lname' => $c['primary_contact_lname'],
- 'contact_type' => $contactType,
- 'contact_role' => $contactRoleNumb,
- 'email' => $c['process_email'],
- 'username' => preg_replace('/[^a-zA-Z0-9_-]+/', '', $c['member_login']),
- 'notes' => 'Imported from old Web site.',
- 'create_time' => date('Y-m-d H:i:s', time()),
- 'ref_type' => $this->config['ref_type_numb']['Member'],
- 'ref_dest' => $memb['id']
+ 'access' => $this->config['access_numb']['NotDisplayedModerated'],
+ 'fname' => $c['primary_contact_fname'],
+ 'lname' => $c['primary_contact_lname'],
+ 'contact_type' => $contactType,
+ 'contact_role' => $contactRoleNumb,
+ 'email' => $c['process_email'],
+ 'username' => $memberLogin,
+ 'notes' => 'Imported from old Web site.',
+ 'create_time' => date('Y-m-d H:i:s', time()),
+ 'ref_type' => $this->config['ref_type_numb']['Member'],
+ 'ref_dest' => $memb['id']
),
array(
'%d',
// Get the contact data into standard parameters
$oldMemberID = ($c[0]-0);
$memberName = trim($c[1]);
- $memberLogin = preg_replace('/[^a-zA-Z0-9_-]+/', '', trim($c[2]));
+ $memberLogin = sanitize_user( $c[2], true );
$memberPasswd = trim($c[3]);
$memberContactEmail = trim($c[4]);