More logging!
Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
parent
f88345cbea
commit
f18e493e32
1 changed files with 6 additions and 0 deletions
|
@ -700,6 +700,7 @@ function fetch_xrd_links($url) {
|
|||
* @return boolean True if it's a valid URL, fals if something wrong with it
|
||||
*/
|
||||
function validate_url(&$url) {
|
||||
logger(sprintf('[%s:%d]: url=%s - CALLED!', __FUNCTION__, __LINE__, $url), LOGGER_TRACE);
|
||||
|
||||
if(get_config('system','disable_url_validation'))
|
||||
return true;
|
||||
|
@ -710,8 +711,13 @@ function validate_url(&$url) {
|
|||
|
||||
if(substr($url,0,4) != 'http' && substr($url,0,5) != 'https')
|
||||
$url = 'http://' . $url;
|
||||
|
||||
logger(sprintf('[%s:%d]: url=%s - before parse_url() ...', __FUNCTION__, __LINE__, $url), LOGGER_DEBUG);
|
||||
|
||||
$h = @parse_url($url);
|
||||
|
||||
logger(sprintf('[%s:%d]: h[]=%s', __FUNCTION__, __LINE__, gettype($h)), LOGGER_DEBUG);
|
||||
|
||||
if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue