의 미러
https://github.com/friendica/friendica
synced 2025-09-07 21:21:52 +02:00
validate_url allow naked subdomain if is "localhost"
This commit is contained in:
부모
60871555f5
커밋
67a2d5be77
1개의 변경된 파일과 4개의 추가작업 그리고 3개의 파일을 삭제
|
@ -587,13 +587,14 @@ function fetch_xrd_links($url) {
|
|||
|
||||
if(! function_exists('validate_url')) {
|
||||
function validate_url(&$url) {
|
||||
// no naked subdomains
|
||||
if(strpos($url,'.') === false)
|
||||
|
||||
// no naked subdomains (allow localhost for tests)
|
||||
if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
|
||||
return false;
|
||||
if(substr($url,0,4) != 'http')
|
||||
$url = 'http://' . $url;
|
||||
$h = @parse_url($url);
|
||||
|
||||
|
||||
if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) {
|
||||
return true;
|
||||
}
|
||||
|
|
불러오는 중…
테이블 추가
Add a link
Reference in a new issue