1
0
mirror of synced 2024-11-21 21:06:09 +03:00

Check email field length (#163)

This commit is contained in:
RenCurs 2020-12-22 13:03:32 +03:00 committed by GitHub
parent 4a5c5d6fd2
commit 797a4d41de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -87,6 +87,8 @@ class RetailCrmOrder
if (in_array($search, array('fio', 'phone', 'email'))) {//fio, phone, email
if ($search == 'fio') {
$order = array_merge($order, RCrmActions::explodeFIO($prop['VALUE'][0]));//add fio fields
} elseif ($search == 'email' && mb_strlen($prop['VALUE'][0]) > 100) {
continue;
} else {
$order[$search] = $prop['VALUE'][0];//phone, email
}

View File

@ -91,6 +91,8 @@ class RetailCrmOrder
if (in_array($search, array('fio', 'phone', 'email'))) {//fio, phone, email
if ($search == 'fio') {
$order = array_merge($order, RCrmActions::explodeFIO($prop['VALUE'][0]));//add fio fields
} elseif ($search == 'email' && mb_strlen($prop['VALUE'][0]) > 100) {
continue;
} else {
// ignoring a property with a non-set group if the field value is already set
if (!empty($order[$search]) && $prop['PROPS_GROUP_ID'] == 0) {

View File

@ -49,6 +49,10 @@ class RetailCrmUser
$customer['address']['index'] = $arFields['PERSONAL_ZIP'];
}
if (mb_strlen($arFields['EMAIL']) > 100 ) {
unset($customer['email']);
}
if ($send && isset($_COOKIE['_rc']) && $_COOKIE['_rc'] != '') {
$customer['browserId'] = $_COOKIE['_rc'];
}
@ -99,6 +103,10 @@ class RetailCrmUser
$customer['patronymic'] = $arFields['SECOND_NAME'];
}
if ( mb_strlen($arFields['EMAIL']) > 100) {
unset($customer['email']);
}
if (!empty($arFields['PERSONAL_PHONE'])) {
$customer['phones'][]['number'] = $arFields['PERSONAL_PHONE'];
}