aboutsummaryrefslogtreecommitdiffstats
path: root/mod/regdir.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-31 21:06:48 -0700
committerfriendica <info@friendica.com>2015-03-31 21:06:48 -0700
commit6f78d7a85d0371dc7fb72acb3a85217005400f91 (patch)
tree89241f3af460da44bc3c9c74e15d7da5dfb4dbec /mod/regdir.php
parentc98de445281e1a819581f96d0919eb5da307c62c (diff)
downloadvolse-hubzilla-6f78d7a85d0371dc7fb72acb3a85217005400f91.tar.gz
volse-hubzilla-6f78d7a85d0371dc7fb72acb3a85217005400f91.tar.bz2
volse-hubzilla-6f78d7a85d0371dc7fb72acb3a85217005400f91.zip
fix regdir
Diffstat (limited to 'mod/regdir.php')
-rw-r--r--mod/regdir.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/mod/regdir.php b/mod/regdir.php
index 025be220b..dce50e76a 100644
--- a/mod/regdir.php
+++ b/mod/regdir.php
@@ -50,7 +50,8 @@ function regdir_init(&$a) {
if ($url) {
$m = parse_url($url);
- if ((! $m) || (! @dns_get_record($m['host'], DNS_A + DNS_CNAME + DNS_PTR)) || (! filter_var($m['host'], FILTER_VALIDATE_IP) )) {
+ if ((! $m) || ((! @dns_get_record($m['host'], DNS_A + DNS_CNAME + DNS_PTR)) && (! filter_var($m['host'], FILTER_VALIDATE_IP) ))) {
+
$result['message'] = 'unparseable url';
json_return_and_die($result);
}
@@ -62,11 +63,13 @@ function regdir_init(&$a) {
$x = import_xchan($j);
if($x['success']) {
$result['success'] = true;
- json_return_and_die($result);
}
}
}
+ if(! $result['success'])
+ $valid = 0;
+
q("update site set site_valid = %d where site_url = '%s' limit 1",
intval($valid),
strtolower($url)
@@ -75,11 +78,11 @@ function regdir_init(&$a) {
json_return_and_die($result);
} else {
- // We can put this in the sql without the condition after 31 april 2015 assuming
+ // We can put this in the sql without the condition after 31 august 2015 assuming
// most directory servers will have updated by then
// This just makes sure it happens if I forget
- $sql_extra = ((datetime_convert() > datetime_convert('UTC','UTC','2015-04-31')) ? ' and site_valid = 1 ' : '' );
+ $sql_extra = ((datetime_convert() > datetime_convert('UTC','UTC','2015-08-31')) ? ' and site_valid = 1 ' : '' );
if ($dirmode == DIRECTORY_MODE_STANDALONE) {
$r = array(array('site_url' => z_root()));
} else {