diff options
author | Friendika <info@friendika.com> | 2011-04-06 05:09:24 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-04-06 05:09:24 -0700 |
commit | 9c77c57b74312a92eada9b84f68addece7a3a27c (patch) | |
tree | f2233252272c04a51e9f62bca74e91f7bb049243 /boot.php | |
parent | ded449f69747856e5a875784544387b2e06054b6 (diff) | |
download | volse-hubzilla-9c77c57b74312a92eada9b84f68addece7a3a27c.tar.gz volse-hubzilla-9c77c57b74312a92eada9b84f68addece7a3a27c.tar.bz2 volse-hubzilla-9c77c57b74312a92eada9b84f68addece7a3a27c.zip |
if base url changes radically, save the change.
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -437,15 +437,18 @@ function check_config(&$a) { load_config('system'); - if(! x($_SERVER,'SERVER_NAME')) - return; - $build = get_config('system','build'); if(! x($build)) $build = set_config('system','build',DB_UPDATE_VERSION); $url = get_config('system','url'); - if(! x($url)) + + // 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. + + if((! x($url)) || (! link_compare($url,$a->get_baseurl()))) $url = set_config('system','url',$a->get_baseurl()); if($build != DB_UPDATE_VERSION) { |