WebsiteBaker Support (2.10.x) > General Help & Support
Again Cyrillic entries error
rumen:
I have change it, but I got the same error what can be the reason?
Gast:
There is a logical problem inside of the proof methods, i need some minutes to repair this, but i have to check every method first
Gast:
so, next try (works for me with latin, cyrillic, hebrew, arabic) -
the charset like this come's from the translation file - in this case specially from the RU.php. All Pages from the Latin languages has the default charset "latin" and no specially definition in the language files.
it's very important, that the translator of the language file set this charset in the language file, otherwhise, he get latin as charset, so check also your bulgarian language file for that
it's also important, that the visited page has this selected language (see page settings). For example: a page with language = english can in this form only work with latin characters, but not with cyrillic
but the check for latin chars work in every language, that means: you can use also latin chars on a russian or arabic page
i hope, it works for you also
--- Quote ---
$us = '';
if (!empty($MOD_BAKERY['ADD_CHARSET'])) {
switch (strtolower($MOD_BAKERY['ADD_CHARSET'])) {
case 'cyrillic':
$us = '\p{Cyrillic}';
break;
case 'greek':
$us = '\p{Greek}';
break;
case 'hebrew':
$us = '\p{Hebrew}';
break;
case 'arabic':
$us = '\p{Arabic}';
break;
default:
$us = '\p{Latin}';
break;
}
}
// Check the textfields
foreach ($_POST as $field => $value) {
if ($field != 'pay_methods') {
$field = strip_tags($field);
$value = strip_tags($value);
if (strpos($field, 'company') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9.+&\s\-]{1,50}+$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_NAME'];
}
}
if (strpos($field, 'first_name') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9\s\-]{1,50}+$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_NAME'];
}
}
if (strpos($field, 'last_name') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9\s\-]{1,50}+$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_NAME'];
}else{echo "geht doch";}
}
if (strpos($field, 'cust_tax_no') !== false &&
strpos($setting_tax_group, $setting_shop_country) !== false) {
include('check_vat.php');
$value = trim($value);
if (!check_vat($value, $setting_tax_group)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_CUST_TAX_NO'];
}
}
if (strpos($field, 'street') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9.+&\s\-]{1,50}$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_STREET'];
}
}
if (strpos($field, 'city') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9.+&\s\-]{1,50}$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_CITY'];
}
}
if (strpos($field, 'state') !== false) {
if (!preg_match('/^[a-zA-Z'. $us .'0-9.+&\s\-]{1,50}$/u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_STATE'];
}
}
if (strpos($field, 'country') !== false) {
if (!preg_match('#^[A-Z]{2}$#u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_COUNTRY'];
}
}
if (strpos($field, 'email') !== false) {
if (!preg_match('#^.+@.+\..+$#u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_EMAIL'];
}
}
if (strpos($field, 'zip') !== false) {
if (!preg_match('#^[A-Za-z0-9\s\-]{4,10}$#u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_ZIP'];
}
}
if (strpos($field, 'phone') !== false) {
if (!preg_match('#^[0-9)(xX+./\s\-]{7,20}$#u', $value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES) . ' ' . $MOD_BAKERY['ERR_INVAL_PHONE'];
}
}
$$field = strip_tags(trim($value));
}
}
--- End quote ---
rumen:
I have changed the code, but same error appeared.
Gast:
what can i say... it works for me with some fictive google translations in the fields -> https://gyazo.com/2ee4eb5d54f18afdd4abfc9e2265771d
is it russian or bulgarian?
you have this line in the bakery-language file?
--- Code: ---$MOD_BAKERY['ADD_CHARSET'] = 'Cyrillic';
--- End code ---
one line from the code has too much content, in the area for the last name at the end, remove this
else{echo "geht doch";}
but it has nothing to do with the form check
Have you try your version from the 1.73?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version