Merge pull request #1091 from bergware/master

Translations: fix creation of empty sessions
This commit is contained in:
tom mortensen
2022-04-29 13:13:36 -07:00
committed by GitHub

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -11,10 +11,14 @@
*/
?>
<?
if (session_status()==PHP_SESSION_NONE && !isset($login_locale)) {
// start new session as required
if (session_status()==PHP_SESSION_NONE && isset($_SESSION) && !isset($login_locale)) {
session_start();
session_write_close();
}
// remove session which is created by scripts
if (session_status()==PHP_SESSION_ACTIVE && count($_SESSION)==1 && isset($_SESSION['locale'])) session_destroy();
require_once "$docroot/webGui/include/Markdown.php";
function _($text, $do=-1) {