aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2012-05-04 10:00:04 +0200
committerzottel <github@zottel.net>2012-05-04 10:00:04 +0200
commita9f825ec3fc8b44115b1fae3b1aeb2c07f23e3de (patch)
tree8c931e7a9feb65af4505864e605dbccf544bfdec /include/network.php
parent35771a778df18afb231969c242680a6353e5ef8e (diff)
parent22c8fe46a554457b43b9721f1f46739511398060 (diff)
downloadvolse-hubzilla-a9f825ec3fc8b44115b1fae3b1aeb2c07f23e3de.tar.gz
volse-hubzilla-a9f825ec3fc8b44115b1fae3b1aeb2c07f23e3de.tar.bz2
volse-hubzilla-a9f825ec3fc8b44115b1fae3b1aeb2c07f23e3de.zip
Merge remote branch 'upstream/master'
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;