aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-11 08:59:16 +0000
committerMario <mario@mariovavti.com>2021-01-11 08:59:16 +0000
commit12ba2c30b907c5350a4a79e04391f5c0e356b547 (patch)
treecf19bf1dbff3d874fd575582dd8d1935f7f51626 /include/dir_fns.php
parent7c1b41019eaf91ba560efb53c77fde06b5ce1c0b (diff)
downloadvolse-hubzilla-12ba2c30b907c5350a4a79e04391f5c0e356b547.tar.gz
volse-hubzilla-12ba2c30b907c5350a4a79e04391f5c0e356b547.tar.bz2
volse-hubzilla-12ba2c30b907c5350a4a79e04391f5c0e356b547.zip
can not access global from statc method
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index b0609ce8b..88a1bb74f 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -16,7 +16,6 @@ require_once('include/permissions.php');
* @return array
*/
function find_upstream_directory($dirmode) {
- global $DIRECTORY_FALLBACK_SERVERS;
$preferred = get_config('system','directory_server');
@@ -43,10 +42,12 @@ function find_upstream_directory($dirmode) {
* directory server if you don't like our choice or if circumstances change.
*/
+ $directory_fallback_servers = get_directory_fallback_servers();
+
$dirmode = intval(get_config('system','directory_mode'));
if ($dirmode == DIRECTORY_MODE_NORMAL) {
- $toss = mt_rand(0,count($DIRECTORY_FALLBACK_SERVERS));
- $preferred = $DIRECTORY_FALLBACK_SERVERS[$toss];
+ $toss = mt_rand(0,count($directory_fallback_servers));
+ $preferred = $directory_fallback_servers[$toss];
set_config('system','directory_server',$preferred);
} else{
set_config('system','directory_server',z_root());