Minishop2: german umlauts (ä, ö, ü)

When saving a new contact/customer german umlauts (ä, ü, ö) are filtered out.
Can I change this?
Is it in the class
msorderhandler
, function
validate($key, $value)
?

case 'receiver':
                // Transforms string from "nikolaj -  coster--Waldau jr." to "Nikolaj Coster-Waldau Jr."
                $tmp = preg_replace(
                    array('/[^-a-zа-яёЁ\s\.]/iu', '/\s+/', '/\-+/', '/\.+/'),
                    array('', ' ', '-', '.'),
                    $value
                );
                $tmp = preg_split('/\s/', $tmp, -1, PREG_SPLIT_NO_EMPTY);
                $tmp = array_map(array($this, 'ucfirst'), $tmp);
                $value = preg_replace('/\s+/', ' ', implode(' ', $tmp));
                if (empty($value)) {
                    $value = false;
                }
                break;
Thank you for your help.
Fabian Christen
29 june 2018, 13:18
290
0

Comments: 2

Василий Наумкин
29 june 2018, 16:21
0
Yes, you can extend this class and change any method — see russian example.

Also you can improve this validator and send PR to miniShop2 repository =)
Fabian Christen
29 june 2018, 16:24
0
Fast and precise as always!
Thank you very much.
Log in or sign in to make new comments.