Skip to content

Commit

Permalink
Merge pull request #55 from gianpietro1/patch-1
Browse files Browse the repository at this point in the history
Propuesta de regexp para nombre y apellido
  • Loading branch information
william-muro-culqi authored Jul 30, 2020
2 parents 103fd99 + cbf8d6d commit 459bf4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions culqi-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ function wc_culqi_scripts()
*/
function some_custom_checkout_field_process() {
error_log("[CULQI]...Validando...");
if(preg_match('/^[^0-9±!@£$%^&*_+§¡€#¢§¶•ªº«\\<>?:;|=.,]{2,50}$/', $_POST['billing_first_name'])) {
if(preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚäöüÄÖÜß\s\-]{2,50}$/', $_POST['billing_first_name'])) {
//error_log("Nombre correcto");
} else {
wc_add_notice('Por favor, ingresa un <strong>nombre </strong>válido', 'error' );
}
if(preg_match('/^[^0-9±!@£$%^&*_+§¡€#¢§¶•ªº«\\<>?:;|=.,]{2,50}$/', $_POST['billing_last_name'])) {
if(preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚäöüÄÖÜß\s\-]{2,50}$/', $_POST['billing_last_name'])) {
//error_log("Apellido correcto");
} else {
wc_add_notice('Por favor, ingresa un <strong>apellido </strong>válido.', 'error' );
Expand Down

0 comments on commit 459bf4d

Please sign in to comment.