Skip to content

Commit 459bf4d

Browse files
Merge pull request #55 from gianpietro1/patch-1
Propuesta de regexp para nombre y apellido
2 parents 103fd99 + cbf8d6d commit 459bf4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: culqi-woocommerce.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ function wc_culqi_scripts()
6969
*/
7070
function some_custom_checkout_field_process() {
7171
error_log("[CULQI]...Validando...");
72-
if(preg_match('/^[^0-9±!@£$%^&*_+§¡€#¢§¶•ªº«\\<>?:;|=.,]{2,50}$/', $_POST['billing_first_name'])) {
72+
if(preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚäöüÄÖÜß\s\-]{2,50}$/', $_POST['billing_first_name'])) {
7373
//error_log("Nombre correcto");
7474
} else {
7575
wc_add_notice('Por favor, ingresa un <strong>nombre </strong>válido', 'error' );
7676
}
77-
if(preg_match('/^[^0-9±!@£$%^&*_+§¡€#¢§¶•ªº«\\<>?:;|=.,]{2,50}$/', $_POST['billing_last_name'])) {
77+
if(preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚäöüÄÖÜß\s\-]{2,50}$/', $_POST['billing_last_name'])) {
7878
//error_log("Apellido correcto");
7979
} else {
8080
wc_add_notice('Por favor, ingresa un <strong>apellido </strong>válido.', 'error' );

0 commit comments

Comments
 (0)