Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
20a25646
Commit
20a25646
authored
Jun 17, 2020
by
alinetenorio
Browse files
alterações na validação de links
parent
e0b96572
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Utils/GrupoPesquisaValidation.php
View file @
20a25646
...
...
@@ -16,10 +16,15 @@ class GrupoPesquisaValidation
$url
=
filter_var
(
$url
,
FILTER_SANITIZE_URL
);
// Validate url
if
(
!
filter_var
(
$url
,
FILTER_VALIDATE_URL
))
{
return
false
;
}
// // Validate url
// if (!filter_var($url, FILTER_VALIDATE_URL)) {
// return false;
// }
//If url doesn't have a protocol
if
(
substr
(
$url
,
0
,
4
)
!=
'http'
){
$url
=
'http://'
.
$url
;
}
if
(
parse_url
(
$url
)[
'host'
]
!=
'dgp.cnpq.br'
){
return
false
;
...
...
app/Utils/LattesValidation.php
View file @
20a25646
...
...
@@ -9,18 +9,26 @@ class LattesValidation
function
isValidUrl
(
$url
)
{
// first do some quick sanity checks:
if
(
!
$url
||
!
is_string
(
$url
))
{
return
false
;
}
$url
=
filter_var
(
$url
,
FILTER_SANITIZE_URL
);
// Validate url
if
(
!
filter_var
(
$url
,
FILTER_VALIDATE_URL
))
{
return
false
;
}
// if (!filter_var($url, FILTER_VALIDATE_URL)) {
// dd('1');
// return false;
// }
//If url doesn't have a protocol
if
(
substr
(
$url
,
0
,
4
)
!=
'http'
){
$url
=
'http://'
.
$url
;
}
//dd(parse_url($url)['host'] != 'lattes.cnpq.br');
if
(
parse_url
(
$url
)[
'host'
]
!=
'buscatextual.cnpq.br'
&&
parse_url
(
$url
)[
'host'
]
!=
'lattes.cnpq.br'
){
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment