Browse Source

And even more logging.

Signed-off-by: Roland Haeder <roland@mxchange.org>
pull/3010/head
Roland Haeder 4 years ago
parent
commit
432f96b646
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      include/network.php

+ 6
- 1
include/network.php View File

@ -703,10 +703,12 @@ function validate_url(&$url) {
logger(sprintf('[%s:%d]: url=%s - CALLED!', __FUNCTION__, __LINE__, $url), LOGGER_TRACE);
if(get_config('system','disable_url_validation'))
logger(sprintf('[%s:%d]: URL validation disabled, returning TRUE - EXIT!', __FUNCTION__, __LINE__), LOGGER_TRACE);
return true;
// no naked subdomains (allow localhost for tests)
if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
logger(sprintf('[%s:%d]: URL is not complete, returning FALSE - EXIT!', __FUNCTION__, __LINE__), LOGGER_TRACE);
return false;
if(substr($url,0,4) != 'http' && substr($url,0,5) != 'https')
@ -718,9 +720,12 @@ function validate_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) )) {
if((is_array($h)) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
logger(sprintf('[%s:%d]: URL %s validated. - EXIT!', __FUNCTION__, __LINE__, $url), LOGGER_TRACE);
return true;
}
logger(sprintf('[%s:%d]: URL %s maybe not valid - EXIT!', __FUNCTION__, __LINE__, $url), LOGGER_TRACE);
return false;
}


Loading…
Cancel
Save