Skip to content
Snippets Groups Projects
Commit fcb79175 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

SQLPermanentStorage: Check for expiration

Fixes https://github.com/simplesamlphp/simplesamlphp/issues/20

The suggested fix in #20 is not a proper one.. It would be overkill to call `$this->store->removeExpired();` on every lookup.. There exists a cron-hook for that.
parent 0d1599a2
No related branches found
No related tags found
No related merge requests found
...@@ -193,12 +193,9 @@ class sspmod_core_Storage_SQLPermanentStorage { ...@@ -193,12 +193,9 @@ class sspmod_core_Storage_SQLPermanentStorage {
if (!is_null($type)) $conditions[] = "type = '" . sqlite_escape_string($type) . "'"; if (!is_null($type)) $conditions[] = "type = '" . sqlite_escape_string($type) . "'";
if (!is_null($key1)) $conditions[] = "key1 = '" . sqlite_escape_string($key1) . "'"; if (!is_null($key1)) $conditions[] = "key1 = '" . sqlite_escape_string($key1) . "'";
if (!is_null($key2)) $conditions[] = "key2 = '" . sqlite_escape_string($key2) . "'"; if (!is_null($key2)) $conditions[] = "key2 = '" . sqlite_escape_string($key2) . "'";
if (count($conditions) === 0) return '1'; $conditions[] = "(expire = NULL OR expire >= ".time().")";
return join(' AND ', $conditions);
$condition = join(' AND ', $conditions);
return $condition;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment