Skip to content

Commit

Permalink
Merge pull request #140 from framer99/php7.2
Browse files Browse the repository at this point in the history
fixes for PHP 7.2
  • Loading branch information
mattpascoe authored Dec 1, 2018
2 parents 53c03bc + 7ac31e4 commit 5f66419
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions www/config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@
// Include the AUTH functions
require_once($conf['inc_functions_auth']);

// Start the session handler (this calls a function defined in functions_general)
startSession();

// Set session inactivity threshold
ini_set("session.gc_maxlifetime", $conf['cookie_life']);

// Start the session handler (this calls a function defined in functions_general)
startSession();

// if search_results_per_page is in the session, set the $conf variable to it. this fixes the /rows command
if (isset($_SESSION['search_results_per_page'])) $conf['search_results_per_page'] = $_SESSION['search_results_per_page'];

Expand Down
9 changes: 5 additions & 4 deletions www/include/adodb_sessions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,20 @@ function sess_read($key) {
printmsg("sess_read($key) called", 6);

list($status, $rows, $record) = db_get_record($SESS_DBH, 'sessions', "`sesskey` = '$key' AND `expiry` > " . time());
if ($status or $rows == 0) { return false; }
if ($status or $rows == 0) { return ''; }

if (array_key_exists('sessvalue', $record)) {
// Update the expiry time (i.e. keep sessions alive even if nothing in the session has changed)
$expiry = time() + $SESS_LIFE;
list($status, $rows) = db_update_record($SESS_DBH, 'sessions', "`sesskey` = '$key' AND `expiry` > " . time(), array('expiry' => $expiry));
if ($status) { return false; }
if ($status) { return ''; }

// Return the value
// Return the value (but not a null)
if ( $record['sessvalue'] == NULL ) { return ''; }
return($record['sessvalue']);
}

return false;
return '';
}


Expand Down
2 changes: 1 addition & 1 deletion www/include/functions_gui.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function workspace_plugin_loader($modulename, $record=array(), $extravars=array(
global $conf, $self, $base, $images, $color, $style, $onadb;
$modhtml = '';
$modjs = '';
$modwsmenu = '';
$modwsmenu = array();
$modbodyhtml = '';
$ws_plugin_dir = "{$base}/workspace_plugins";

Expand Down

0 comments on commit 5f66419

Please sign in to comment.