diff options
author | Mario Vavti <mario@mariovavti.com> | 2024-10-30 12:50:08 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2024-10-30 12:50:08 +0100 |
commit | 005d4ad35143e417b7c1dbfbf38417dee03e9608 (patch) | |
tree | 26ca21abd63168b3ddbd0f963f6f2473ac11eeab /Zotlabs | |
parent | 68135c28da286bb23978f6181c46edf56c37b06e (diff) | |
parent | 90a1dad02c24dcb3bc629e198ad24adc0b7566d3 (diff) | |
download | volse-hubzilla-005d4ad35143e417b7c1dbfbf38417dee03e9608.tar.gz volse-hubzilla-005d4ad35143e417b7c1dbfbf38417dee03e9608.tar.bz2 volse-hubzilla-005d4ad35143e417b7c1dbfbf38417dee03e9608.zip |
Merge branch 'dev' into containers
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/DB_Upgrade.php | 31 | ||||
-rw-r--r-- | Zotlabs/Web/WebServer.php | 4 |
2 files changed, 27 insertions, 8 deletions
diff --git a/Zotlabs/Lib/DB_Upgrade.php b/Zotlabs/Lib/DB_Upgrade.php index 981c354a4..e11c2eb10 100644 --- a/Zotlabs/Lib/DB_Upgrade.php +++ b/Zotlabs/Lib/DB_Upgrade.php @@ -1,18 +1,35 @@ <?php +/** + * A class to handle database schema upgrades. + * + * SPDX-FileCopyrightText: 2024 Hubzilla Community + * SPDX-FileContributor: Harald Eilertsen + * + * SPDX-License-Identifier: MIT + */ namespace Zotlabs\Lib; use Zotlabs\Lib\Config; +/** + * Upgrade the database schema if necessary. + * + * Compares the currently active database schema version with the version + * required for this version of Hubzilla, and performs the upgrade if needed. + * + * If the difference consists of more than one revision of the schema, each of + * the intermediate upgrades are performed in turn. + */ class DB_Upgrade { - public $config_name = ''; - public $func_prefix = ''; - - function __construct($db_revision) { - - $this->config_name = 'db_version'; - $this->func_prefix = '_'; + /** + * Check the installed and required schema versions and perform the upgrade + * if necessary. + * + * @param int $db_version The required DB schema version. + */ + public static function run(int $db_revision): void { $build = Config::Get('system', 'db_version', 0); if(! intval($build)) diff --git a/Zotlabs/Web/WebServer.php b/Zotlabs/Web/WebServer.php index 6f8a4b956..19f14ee8a 100644 --- a/Zotlabs/Web/WebServer.php +++ b/Zotlabs/Web/WebServer.php @@ -2,6 +2,8 @@ namespace Zotlabs\Web; +use Zotlabs\Lib\Text; + class WebServer { public function run() { @@ -60,7 +62,7 @@ class WebServer { \App::$query_string = strip_zids(\App::$query_string); if(! local_channel()) { if (!isset($_SESSION['my_address']) || $_SESSION['my_address'] != $_GET['zid']) { - $_SESSION['my_address'] = $_GET['zid']; + $_SESSION['my_address'] = Text::escape_tags($_GET['zid']); $_SESSION['authenticated'] = 0; } if(!$_SESSION['authenticated']) { |