aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-05-05 20:48:16 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-05-05 20:48:16 +0530
commitb5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80 (patch)
tree74234775d723e33378059f2fa45fa80e3bc6ac43 /include/network.php
parent214ec91a3f2c5fec6cced93f669b3a9725f0e40a (diff)
parent8ae83201cf8f3c943972a8f246b7972aa640afb4 (diff)
downloadvolse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.tar.gz
volse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.tar.bz2
volse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php
index 4bec4a172..27a45ec40 100644
--- a/include/network.php
+++ b/include/network.php
@@ -583,7 +583,7 @@ function fetch_xrd_links($url) {
// Take a URL from the wild, prepend http:// if necessary
-// and check DNS to see if it's real
+// and check DNS to see if it's real (or check if is a valid IP address)
// return true if it's OK, false if something is wrong with it
if(! function_exists('validate_url')) {
@@ -596,7 +596,7 @@ function validate_url(&$url) {
$url = 'http://' . $url;
$h = @parse_url($url);
- if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) {
+ if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
return true;
}
return false;
@@ -611,7 +611,7 @@ function validate_email($addr) {
return false;
$h = substr($addr,strpos($addr,'@') + 1);
- if(($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_PTR + DNS_MX))) {
+ if(($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_PTR + DNS_MX) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
return true;
}
return false;