aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-09 14:53:58 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-09 14:53:58 -0800
commit862a31007543c292ba3bcd6d56e390d83c1043be (patch)
tree96a21ec9828300c8b882f291ffc2393156158f54 /include
parent271a41b7ddcd07fbb75e8b287c32b75ec2745c7c (diff)
downloadvolse-hubzilla-862a31007543c292ba3bcd6d56e390d83c1043be.tar.gz
volse-hubzilla-862a31007543c292ba3bcd6d56e390d83c1043be.tar.bz2
volse-hubzilla-862a31007543c292ba3bcd6d56e390d83c1043be.zip
thwart attempts to use an external private directory as a directory server
Diffstat (limited to 'include')
-rw-r--r--include/dir_fns.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index e5f0e1e2b..398f43d00 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -15,6 +15,19 @@ function find_upstream_directory($dirmode) {
global $DIRECTORY_FALLBACK_SERVERS;
$preferred = get_config('system','directory_server');
+
+ // Thwart attempts to use a private directory
+
+ if(($preferred) && ($prefered != z_root())) {
+ $r = q("select * from site where site_url = '%s' limit 1",
+ dbesc($preferred)
+ );
+ if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STADALONE)) {
+ $preferred = '';
+ }
+ }
+
+
if (! $preferred) {
/*