Skip to content
Permalink
Browse files

* Very minor session changes that have always worked fine on Lestrade…

…'s, so I'm guessing they're good enough for production. (Load.php)
  • Loading branch information...
Nao committed May 23, 2018
1 parent 31e2141 commit 35ed2bf9336b0b94fc7b534d9d948e9ce2774e38
Showing with 7 additions and 6 deletions.
  1. +7 −6 core/app/Load.php
@@ -2257,7 +2257,7 @@ function loadSession()
elseif (ini_get('session.gc_maxlifetime') <= 1440 && !empty($settings['databaseSession_lifetime']))
ini_set('session.gc_maxlifetime', max($settings['databaseSession_lifetime'], 60));
session_start();
@session_start();
// Change it so the cache settings are a little looser than default.
if (!empty($settings['databaseSession_loose']))
@@ -2351,14 +2351,15 @@ function sessionWrite($session_id, $data)
*/
function sessionDestroy($session_id)
{
global $db_link, $db_prefix;
if (!preg_match('~^[a-zA-Z0-9,-]{16,32}$~', $session_id) || !isset($db_link))
if (preg_match('~^[a-zA-Z0-9,-]{16,32}$~', $session_id) == 0)
return false;
// Just delete the row...
mysqli_query($db_link, 'DELETE FROM ' . $db_prefix . 'sessions WHERE session_id = "' . mysqli_real_escape_string($db_link, $session_id) . '"');
wesql::query('
DELETE FROM {db_prefix}sessions
WHERE session_id = {string:session_id}',
array('session_id' => $session_id)
);
return true;
}

0 comments on commit 35ed2bf

Please sign in to comment.
You can’t perform that action at this time.