validate_url allow naked subdomain if is "localhost"
This commit is contained in:
parent
60871555f5
commit
67a2d5be77
1 changed files with 4 additions and 3 deletions
|
@ -587,8 +587,9 @@ function fetch_xrd_links($url) {
|
||||||
|
|
||||||
if(! function_exists('validate_url')) {
|
if(! function_exists('validate_url')) {
|
||||||
function validate_url(&$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;
|
return false;
|
||||||
if(substr($url,0,4) != 'http')
|
if(substr($url,0,4) != 'http')
|
||||||
$url = 'http://' . $url;
|
$url = 'http://' . $url;
|
||||||
|
|
Loading…
Reference in a new issue