aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-01-31 09:49:00 +0100
committerMario Vavti <mario@mariovavti.com>2022-01-31 09:49:00 +0100
commit6c808abcfc9a52f8f331f9bfb58a455a90d1970d (patch)
tree34a84ee5674b832daf89a3654de7032dc25f226a /Zotlabs/Web
parentf1822bdfab8a5b997c32faa9c287a3fba1c0729b (diff)
downloadvolse-hubzilla-6c808abcfc9a52f8f331f9bfb58a455a90d1970d.tar.gz
volse-hubzilla-6c808abcfc9a52f8f331f9bfb58a455a90d1970d.tar.bz2
volse-hubzilla-6c808abcfc9a52f8f331f9bfb58a455a90d1970d.zip
PHP 8.1 band-aid
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/SessionHandler.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/Zotlabs/Web/SessionHandler.php b/Zotlabs/Web/SessionHandler.php
index 4292fdc28..392cab1ae 100644
--- a/Zotlabs/Web/SessionHandler.php
+++ b/Zotlabs/Web/SessionHandler.php
@@ -6,7 +6,7 @@ namespace Zotlabs\Web;
class SessionHandler implements \SessionHandlerInterface {
- function open ($s, $n) {
+ function open ($s, $n) : bool {
return true;
}
@@ -15,7 +15,7 @@ class SessionHandler implements \SessionHandlerInterface {
// some which call read explicitly and some that do not. So we call it explicitly
// just after sid regeneration to force a record to exist.
- function read ($id) {
+ function read ($id) : string|false {
if($id) {
$r = q("SELECT sess_data FROM session WHERE sid= '%s'", dbesc($id));
@@ -36,7 +36,7 @@ class SessionHandler implements \SessionHandlerInterface {
}
- function write ($id, $data) {
+ function write ($id, $data) : bool {
// Pretend everything is hunky-dory, even though it isn't.
// There probably isn't anything we can do about it in any event.
@@ -49,9 +49,9 @@ class SessionHandler implements \SessionHandlerInterface {
// Unless we authenticate somehow, only keep a session for 5 minutes
// The viewer can extend this by performing any web action using the
- // original cookie, but this allows us to cleanup the hundreds or
+ // original cookie, but this allows us to cleanup the hundreds or
// thousands of empty sessions left around from web crawlers which are
- // assigned cookies on each page that they never use.
+ // assigned cookies on each page that they never use.
$expire = time() + 300;
@@ -74,19 +74,19 @@ class SessionHandler implements \SessionHandlerInterface {
return true;
}
-
- function close() {
+
+ function close() : bool {
return true;
}
- function destroy ($id) {
+ function destroy ($id) : bool {
q("DELETE FROM session WHERE sid = '%s'", dbesc($id));
return true;
}
- function gc($expire) {
+ function gc($expire) : int|false {
q("DELETE FROM session WHERE expire < %d", dbesc(time()));
return true;
}