Bugzilla – Attachment 130167 Details for
Bug 30026
International phone number not supported for sending SMS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30026: SMSAlert regex fixed for international
-Bug-30026-SMSAlert-regex-fixed-for-international.patch (text/plain), 2.21 KB, created by
Florian
on 2022-02-04 16:04:50 UTC
(
hide
)
Description:
Bug 30026: SMSAlert regex fixed for international
Filename:
MIME Type:
Creator:
Florian
Created:
2022-02-04 16:04:50 UTC
Size:
2.21 KB
patch
obsolete
>From f7e8e5fa73a85ada7986b8f40cab8e1166a970a6 Mon Sep 17 00:00:00 2001 >From: Florian Bontemps <florian.bontemps@biblibre.com> >Date: Fri, 4 Feb 2022 15:40:33 +0000 >Subject: [PATCH] Bug 30026: SMSAlert regex fixed for international > > When registering a phone number for SMS alerts, the number goes through a regex filter to make sure the number is valid. > One of the formats used in Europe is 00 AAA XXXXXXXXX (A = country indicator) and it is not supported. > This patch adjusts the regex to either accept 00 AAA XXXXXXXXX or +AAAXXXXXXXXX in this case. > (Note : +AAA and 00AAA are mutually exclusive). > > To test: > 1) You need to have installed a SMSAlert plugin. Make sure the SMSSendDriver syspref is also set up with your SMS plugin of choice. > 2) Pick a patron and edit its profile. > 3) In the messaging preferences fieldset, under SMS number, enter any number with the format 00 AAA XXXXXXXXX (ie : 00111123456789). > Try to save the modification : you should have an error message. > 4) Try instead a number with the format +AAAXXXXXXXXX (ie : 111123456789), that one should be accepted. > 5) Save your modification then check that the number has been changed. > 6) Apply patch. > 7) Repeat step 3 to 5. > 8) Observe the error is gone. > 9) Try it once more with the format +00 AAA XXXXXXXXX (+00111123456789), that format should not be accepted: this is intentional. > 10) Sign off. > > Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index a9e6a870ae..0e7faf1956 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -225,7 +225,7 @@ $(document).ready(function(){ > $.validator.addMethod( > "phone", > function(value, element, phone) { >- let e164_re = /^(\+[1-9]\d{0,2})?\d{1,12}$/; >+ let e164_re = /^((\+?|(0{2})?)?[1-9]{0,2})?\d{1,12}$/; > let has_plus = value.charAt(0) === '+'; > value = value.replace(/\D/g,''); > if ( has_plus ) value = '+' + value; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30026
:
130167
|
131375
|
134756
|
134757
|
134954
|
134955