Skip to content

Commit 4a33e61

Browse files
committed
Prepare code for v23
1 parent 3270d79 commit 4a33e61

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

htdocs/cabinetmed/canvas/patient/tpl/card_create.tpl.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@
109109
$object->phone = GETPOST('phone', 'alpha');
110110
$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
111111
$object->fax = GETPOST('fax', 'alpha');
112-
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
113-
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
112+
$object->email = GETPOST('email', 'email');
113+
if ((float) DOL_VERSION >= 23) {
114+
$object->url = GETPOST('url', 'url');
115+
} else {
116+
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
117+
}
114118
$object->capital = GETPOSTFLOAT('capital');
115119
$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
116120
if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {

htdocs/cabinetmed/canvas/patient/tpl/card_edit.tpl.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,13 @@
102102
$object->phone = GETPOST('phone', 'alpha');
103103
$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
104104
$object->fax = GETPOST('fax', 'alpha');
105-
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
105+
$object->email = GETPOST('email', 'email');
106106
$object->no_email = GETPOSTINT("no_email");
107-
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
107+
if ((float) DOL_VERSION >= 23) {
108+
$object->url = GETPOST('url', 'url');
109+
} else {
110+
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
111+
}
108112
$object->capital = GETPOST('capital', 'alphanohtml');
109113
$object->idprof1 = GETPOST('idprof1', 'alphanohtml');
110114
$object->idprof2 = GETPOST('idprof2', 'alphanohtml');

htdocs/cabinetmed/card.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,13 @@
393393
$object->phone = GETPOST('phone', 'alpha');
394394
$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
395395
$object->fax = GETPOST('fax', 'alpha');
396-
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
396+
$object->email = trim(GETPOST('email', 'email'));
397397
$object->no_email = GETPOSTINT("no_email");
398-
$object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
398+
if ((float) DOL_VERSION >= 23) {
399+
$object->url = GETPOST('url', 'url');
400+
} else {
401+
$object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
402+
}
399403
$object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml'));
400404
$object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml'));
401405
$object->idprof3 = trim(GETPOST('idprof3', 'alphanohtml'));
@@ -441,7 +445,11 @@
441445
$object->default_lang = GETPOST('default_lang');
442446

443447
// Webservices url/key
444-
$object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
448+
if ((float) DOL_VERSION >= 23) {
449+
$object->webservices_url = GETPOST('webservices_url', 'url');
450+
} else {
451+
$object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
452+
}
445453
$object->webservices_key = GETPOST('webservices_key', 'san_alpha');
446454

447455
// Incoterms

0 commit comments

Comments
 (0)