Validate domain names #48

Merged
lpoujol merged 5 commits from features/validate-domains into master 2019-03-20 16:40:09 +01:00
Owner
No description provided.
Author
Owner

Devrait corriger #24, #18, #14 :)

Devrait corriger #24, #18, #14 :)
First-time contributor

Plutôt que faire des Regex, PHP a des fonctions de filtrages, ex. filter_var, filter_input_array qui font déjà le boulot avec le filtre FILTER_VALIDATE_DOMAIN.

Plutôt que faire des Regex, PHP a des fonctions de filtrages, ex. **filter_var**, **filter_input_array** qui font déjà le boulot avec le filtre **FILTER_VALIDATE_DOMAIN**.
Author
Owner

Initialement, c'est ce que j'ai souhaité faire.
Mais ça laisse justement passer les cas problématiques...

var_dump(filter_var('this;isgarbage.com', FILTER_VALIDATE_DOMAIN ));
// string(18) "this;isgarbage.com"

var_dump(filter_var('https://example.net/', FILTER_VALIDATE_DOMAIN ));
// string(20) "https://example.net/"

var_dump(filter_var('how.about..no.', FILTER_VALIDATE_DOMAIN ));
// bool(false)
Initialement, c'est ce que j'ai souhaité faire. Mais ça laisse justement passer les cas problématiques... ~~~php var_dump(filter_var('this;isgarbage.com', FILTER_VALIDATE_DOMAIN )); // string(18) "this;isgarbage.com" var_dump(filter_var('https://example.net/', FILTER_VALIDATE_DOMAIN )); // string(20) "https://example.net/" var_dump(filter_var('how.about..no.', FILTER_VALIDATE_DOMAIN )); // bool(false) ~~~
lpoujol changed title from WIP: Validate domain names to Validate domain names 2019-03-20 16:38:41 +01:00
lpoujol closed this pull request 2019-03-20 16:40:09 +01:00
lpoujol deleted branch features/validate-domains 2019-03-20 16:41:20 +01:00
Sign in to join this conversation.
No description provided.