An error occurred when logging in with a mobile phone number

Any critical bugs will be fixed within 24-48 hours.
Post Reply
User avatar
lvyulin
Posts: 69
Joined: 12 Dec 2022, 11:55
Name: les lv
Location: shanghai

An error occurred when logging in with a mobile phone number

Post by lvyulin »

An error occurred when logging in with a mobile phone number. After modifying it to this, it can be used. What is the problem

path:\modules\users\actions\login_by_phone.php
Original code:
$user_query = db_query("select id from app_entity_1 where length(field_" . CFG_2STEP_VERIFICATION_USER_PHONE . ")>0 and rukovoditel_regex_replace('[^0-9]','',field_" . CFG_2STEP_VERIFICATION_USER_PHONE . ") = '" . db_input(preg_replace('/\D/', '', $_POST['phone'])) . "'");
Change to:
$user_query = db_query("select id from app_entity_1 where length(field_" . CFG_2STEP_VERIFICATION_USER_PHONE . ")>0 and TRIM(REPLACE(field_" . CFG_2STEP_VERIFICATION_USER_PHONE . ", '[^0-9]', '')) = '" . db_input(preg_replace('/\D/', '', $_POST['phone'])) . "'");
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: An error occurred when logging in with a mobile phone number

Post by support »

rukovoditel_regex_replace function is added automatically to your database when you add filed type phone number.
User avatar
lvyulin
Posts: 69
Joined: 12 Dec 2022, 11:55
Name: les lv
Location: shanghai

Re: An error occurred when logging in with a mobile phone number

Post by lvyulin »

OK
Post Reply