You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Neos.Flow/Classes/Session/Aspect/SessionObjectMethodsPointcutFilter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ public function injectObjectManager(CompileTimeObjectManager $objectManager): vo
37
37
* Checks if the specified class and method matches against the filter
38
38
*
39
39
* @param string $className Name of the class to check against
40
-
* @param string $methodName Name of the method to check against
40
+
* @param ?string $methodName Name of the method to check against
41
41
* @param string $methodDeclaringClassName Name of the class the method was originally declared in
42
42
* @param mixed $pointcutQueryIdentifier Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
43
43
* @return bool true if the class / method match, otherwise false
@@ -79,7 +79,7 @@ public function hasRuntimeEvaluationsDefinition(): bool
79
79
/**
80
80
* Returns runtime evaluations for a previously matched pointcut
@@ -276,6 +297,12 @@ public function renewId(): string
276
297
if ($this->started !== true) {
277
298
thrownewException\SessionNotStartedException('Tried to renew the session identifier, but the session has not been started yet.', 1351182429);
278
299
}
300
+
if (!$this->sessionMetaData) {
301
+
thrownew \Exception('Missing session metadata');
302
+
}
303
+
if (!$this->sessionCookie) {
304
+
thrownew \Exception('Missing session cookie');
305
+
}
279
306
if ($this->remote === true) {
280
307
thrownewException\OperationNotSupportedException(sprintf('Tried to renew the session identifier on a remote session (%s).', $this->sessionMetaData->sessionIdentifier->value), 1354034230);
281
308
}
@@ -284,6 +311,12 @@ public function renewId(): string
if ($this->started !== true || !$this->sessionMetaData) {
336
369
thrownewException\SessionNotStartedException('Tried to create a session data entry, but the session has not been started yet.', 1351162259);
337
370
}
338
371
if (is_resource($data)) {
@@ -354,7 +387,7 @@ public function putData(string $key, mixed $data): void
354
387
*/
355
388
publicfunctiongetLastActivityTimestamp(): int
356
389
{
357
-
if ($this->started !== true) {
390
+
if ($this->started !== true || !$this->sessionMetaData) {
358
391
thrownewException\SessionNotStartedException('Tried to retrieve the last activity timestamp of a session which has not been started yet.', 1354290378);
@@ -378,9 +411,9 @@ public function addTag(string $tag): void
378
411
thrownewException\SessionNotStartedException('Tried to tag a session which has not been started yet.', 1355143533);
379
412
}
380
413
if (!$this->sessionMetaDataStore->isValidSessionTag($tag)) {
381
-
thrownew \InvalidArgumentException(sprintf('The tag used for tagging session %s contained invalid characters. Make sure it matches this regular expression: "%s"', $this->sessionMetaData->sessionIdentifier->value, FrontendInterface::PATTERN_TAG));
414
+
thrownew \InvalidArgumentException(sprintf('The tag used for tagging session %s contained invalid characters. Make sure it matches this regular expression: "%s"', $this->sessionMetaData?->sessionIdentifier->value ?: '', FrontendInterface::PATTERN_TAG));
if ($this->inactivityTimeout !== 0 && $lastActivitySecondsAgo > $this->inactivityTimeout) {
503
542
$this->started = true;
504
-
$this->destroy(sprintf('Session %s was inactive for %s seconds, more than the configured timeout of %s seconds.', $this->sessionMetaData->sessionIdentifier->value, $lastActivitySecondsAgo, $this->inactivityTimeout));
543
+
$this->destroy(sprintf('Session %s was inactive for %s seconds, more than the configured timeout of %s seconds.', $this->sessionMetaData?->sessionIdentifier->value ?: '', $lastActivitySecondsAgo, $this->inactivityTimeout));
505
544
$expired = true;
506
545
}
507
546
return$expired;
@@ -521,6 +560,8 @@ protected function autoExpire(): bool
0 commit comments