diff options
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 96 |
1 files changed, 52 insertions, 44 deletions
@@ -66,7 +66,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '9.2'); +define('STD_VERSION', '10.2.3'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); @@ -1270,8 +1270,9 @@ class App { '$js_strings' => js_strings(), '$zid' => get_my_address(), '$channel_id' => self::$profile['uid'] ?? 0, - '$auto_save_draft' => ((isset(self::$profile['uid']) && feature_enabled(self::$profile['uid'], 'auto_save_draft')) ? "true" : "false"), - '$module' => App::$module + '$auto_save_draft' => ((isset(self::$profile_uid) && feature_enabled(self::$profile_uid, 'auto_save_draft')) ? "true" : "false"), + '$module' => App::$module, + '$lang' => App::$language ] ) . ((isset(self::$page['htmlhead'])) ? self::$page['htmlhead'] : ''); @@ -1538,14 +1539,7 @@ function check_config() { App::set_baseurl(z_root()); - // Make sure each site has a system channel. This is now created on install - // so we just need to keep this around a couple of weeks until the hubs that - // already exist have one - $syschan_exists = get_sys_channel(); - if (!$syschan_exists) - create_sys_channel(); - - new DB_Upgrade(DB_UPDATE_VERSION); + DB_Upgrade::run(DB_UPDATE_VERSION); plugins_sync(); @@ -1897,23 +1891,26 @@ function can_view_public_stream() { */ function notice($s) { - /* - if(! session_id()) - return; +/* - if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); + if (!session_id()) { + return; + } - // ignore duplicated error messages which haven't yet been displayed - // - typically seen as multiple 'permission denied' messages - // as a result of auto-reloading a protected page with &JS=1 + if (!isset($_SESSION['sysmsg'])) { + $_SESSION['sysmsg'] = []; + } - if(in_array($s, $_SESSION['sysmsg'])) - return; + // ignore duplicated error messages which haven't yet been displayed - if(App::$interactive) { - $_SESSION['sysmsg'][] = $s; - } - */ + if (in_array($s, $_SESSION['sysmsg'])) { + return; + } + + if (App::$interactive) { + $_SESSION['sysmsg'][] = $s; + } +*/ $hash = get_observer_hash(); $sse_id = false; @@ -1928,19 +1925,22 @@ function notice($s) { } } + $x = null; + $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE); if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) { set_xconfig($hash, 'sse', 'notifications', []); + $x = []; } - $x = get_xconfig($hash, 'sse', 'notifications'); - - if ($x === false) - $x = []; + if ($x === null) { + $x = get_xconfig($hash, 'sse', 'notifications', []); + } - if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) + if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) { return; + } if (App::$interactive) { $x['notice']['notifications'][] = $s; @@ -1960,20 +1960,25 @@ function notice($s) { * @param string $s Text to display */ function info($s) { +/* + if (!session_id()) { + return; + } - /* - if(! session_id()) - return; + if (!isset($_SESSION['sysmsg_info'])) { + $_SESSION['sysmsg_info'] = []; + } - if(! x($_SESSION, 'sysmsg_info')) - $_SESSION['sysmsg_info'] = array(); + // ignore duplicated error messages which haven't yet been displayed - if(in_array($s, $_SESSION['sysmsg_info'])) - return; + if (in_array($s, $_SESSION['sysmsg_info'])) { + return; + } - if(App::$interactive) - $_SESSION['sysmsg_info'][] = $s; - */ + if (App::$interactive) { + $_SESSION['sysmsg_info'][] = $s; + } +*/ $hash = get_observer_hash(); $sse_id = false; @@ -1988,19 +1993,22 @@ function info($s) { } } + $x = null; + $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE); if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) { set_xconfig($hash, 'sse', 'notifications', []); + $x = []; } - $x = get_xconfig($hash, 'sse', 'notifications'); - - if ($x === false) - $x = []; + if ($x === null) { + $x = get_xconfig($hash, 'sse', 'notifications', []); + } - if (isset($x['info']) && in_array($s, $x['info']['notifications'])) + if (isset($x['info']) && in_array($s, $x['info']['notifications'])) { return; + } if (App::$interactive) { $x['info']['notifications'][] = $s; |