From: Hypolite Petovan Date: Sat, 3 Feb 2018 05:46:05 +0000 (-0500) Subject: Switch to Core\Session X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d5753b21aed828648e8edf05c78a5253ecca8436;p=friendica.git Switch to Core\Session - Remove reference to include/session - Use new Session::init() - Prevent variable re-assignation if they're just empty - Deprecate killme() function - Correct DOMXPath class spelling --- diff --git a/boot.php b/boot.php index 732816d1b9..779a41f400 100644 --- a/boot.php +++ b/boot.php @@ -873,13 +873,10 @@ function get_guid($size = 16, $prefix = "") /** * @brief Used to end the current process, after saving session state. + * @deprecated */ function killme() { - if (!get_app()->is_backend()) { - session_write_close(); - } - exit(); } diff --git a/index.php b/index.php index 2f07fa9af9..af493f2016 100644 --- a/index.php +++ b/index.php @@ -12,10 +12,11 @@ use Friendica\App; use Friendica\BaseObject; use Friendica\Content\Nav; use Friendica\Core\Addon; -use Friendica\Core\System; -use Friendica\Core\Theme; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Core\Session; +use Friendica\Core\System; +use Friendica\Core\Theme; use Friendica\Core\Worker; use Friendica\Database\DBM; use Friendica\Model\Profile; @@ -77,7 +78,7 @@ if (!$install) { exit(); } - require_once 'include/session.php'; + Session::init(); Addon::loadHooks(); Addon::callHooks('init_1'); @@ -166,16 +167,16 @@ $a->page['htmlhead'] = ''; $a->page['end'] = ''; -if (! x($_SESSION, 'sysmsg')) { +if (x($_SESSION, 'sysmsg') === false) { $_SESSION['sysmsg'] = []; } -if (! x($_SESSION, 'sysmsg_info')) { +if (x($_SESSION, 'sysmsg_info') === false) { $_SESSION['sysmsg_info'] = []; } // Array for informations about last received items -if (! x($_SESSION, 'last_updated')) { +if (x($_SESSION, 'last_updated') === false) { $_SESSION['last_updated'] = []; } /* @@ -474,7 +475,7 @@ if (isset($_GET["mode"]) && (($_GET["mode"] == "raw") || ($_GET["mode"] == "mini /// @TODO one day, kill those error-surpressing @ stuff, or PHP should ban it @$doc->loadHTML($content); - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $list = $xpath->query("//*[contains(@id,'tread-wrapper-')]"); /* */