diff options
author | friendica <info@friendica.com> | 2013-05-28 22:58:59 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-05-28 22:58:59 -0700 |
commit | 2a6d3e1f940af1819182be5710eb6a1f45de1929 (patch) | |
tree | d2c6b52e3feb4628eae162bc405fb115c101fef7 /boot.php | |
parent | b25783b9b6a3977df45c0b51c666c9271c8fdc98 (diff) | |
download | volse-hubzilla-2a6d3e1f940af1819182be5710eb6a1f45de1929.tar.gz volse-hubzilla-2a6d3e1f940af1819182be5710eb6a1f45de1929.tar.bz2 volse-hubzilla-2a6d3e1f940af1819182be5710eb6a1f45de1929.zip |
make sure we get the correct URL. Also redirect back again (essentially perform a no-op) when using reverse magic auth and we can't find a channel.
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 49 |
1 files changed, 14 insertions, 35 deletions
@@ -709,17 +709,8 @@ class App { $scheme = $this->scheme; if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) { - if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL)) + if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL)) { $scheme = 'https'; - - // Basically, we have $ssl = true on any links which can only be seen by a logged in user - // (and also the login link). Anything seen by an outsider will have it turned off. - - if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) { - if($ssl) - $scheme = 'https'; - else - $scheme = 'http'; } } @@ -1094,32 +1085,20 @@ function check_config(&$a) { if(! x($build)) $build = set_config('system','db_version',DB_UPDATE_VERSION); - $saved = get_config('system','urlverify'); - if(! $saved) - set_config('system','urlverify',bin2hex(z_root())); - if(($saved) && ($saved != bin2hex(z_root()))) { - // our URL changed. Do something. - $oldurl = hex2bin($saved); - fix_system_urls($oldurl,z_root()); - set_config('system','urlverify',bin2hex(z_root())); - - } - - -// $url = get_config('system','baseurl'); - - // if the url isn't set or the stored url is radically different - // than the currently visited url, store the current value accordingly. - // "Radically different" ignores common variations such as http vs https - // and www.example.com vs example.com. - // We will only change the url to an ip address if there is no existing setting - -// if(! x($url)) -// $url = set_config('system','baseurl',$a->get_baseurl()); -// if((! link_compare($url,$a->get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname))) -// $url = set_config('system','baseurl',$a->get_baseurl()); + $saved = get_config('system','urlverify'); + if(! $saved) + set_config('system','urlverify',bin2hex(z_root())); + if(($saved) && ($saved != bin2hex(z_root()))) { + // our URL changed. Do something. + $oldurl = hex2bin($saved); + fix_system_urls($oldurl,z_root()); + set_config('system','urlverify',bin2hex(z_root())); + } + // This will actually set the url to the one stored in .htconfig, and ignore what + // we're passing - unless we are installing and it has never been set. + $a->set_baseurl($a->get_baseurl()); if($build != DB_UPDATE_VERSION) { $stored = intval($build); @@ -2111,7 +2090,7 @@ function zid_init(&$a) { $dest = '/' . $a->query_string; $dest = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$dest); if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) { - goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . z_root() . $dest); + goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&dest=' . z_root() . $dest); } } } |