Skip to content

Commit

Permalink
Fix undefined issues (#4804)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvz committed Apr 24, 2024
1 parent 7ff1ba5 commit 50d3006
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/class_session.php
Expand Up @@ -357,6 +357,8 @@ function load_guest()
$mybb->user['moderateposts'] = 0;
$mybb->user['showquickreply'] = 1;
$mybb->user['signature'] = '';
$mybb->user['sourceeditor'] = 0;
$mybb->user['subscriptionmethod'] = 0;
$mybb->user['suspendposting'] = 0;

// Has this user visited before? Lastvisit need updating?
Expand All @@ -371,7 +373,7 @@ function load_guest()
{
$mybb->user['lastactive'] = (int)$mybb->cookies['mybb']['lastactive'];
}
if($time - $mybb->cookies['mybb']['lastactive'] > 900)
if($time - (int)$mybb->cookies['mybb']['lastactive'] > 900)
{
my_setcookie("mybb[lastvisit]", $mybb->user['lastactive']);
$mybb->user['lastvisit'] = $mybb->user['lastactive'];
Expand Down
1 change: 1 addition & 0 deletions newreply.php
Expand Up @@ -1184,6 +1184,7 @@
}

// If the user is logged in, provide a save draft button.
$savedraftbutton = '';
if($mybb->user['uid'])
{
eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
Expand Down
1 change: 1 addition & 0 deletions newthread.php
Expand Up @@ -1032,6 +1032,7 @@
$attachbox = '';
}

$savedraftbutton = '';
if($mybb->user['uid'])
{
eval("\$savedraftbutton = \"".$templates->get("post_savedraftbutton", 1, 0)."\";");
Expand Down

0 comments on commit 50d3006

Please sign in to comment.