From 2ba38e0e4970d577f9fd8bc3b6e4a73c19cdc8b9 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 14 Apr 2022 10:13:30 +0200 Subject: [PATCH] prevent symfony expression language error while tracking Some requests do not provide a user agent, the left side will result in null instead of empty string, leading to issues when applying matches. Therefore a check whether agent exists is applied first. --- Configuration/Services/Tracking.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Configuration/Services/Tracking.yaml b/Configuration/Services/Tracking.yaml index d126bd1..1724737 100644 --- a/Configuration/Services/Tracking.yaml +++ b/Configuration/Services/Tracking.yaml @@ -134,6 +134,7 @@ services: $rule: > not (context.getAspect("backend.user").isLoggedIn()) and not (context.getAspect("frontend.preview").isPreview()) + and request.getHeader("User-Agent")[0] and not (request.getHeader("User-Agent")[0] matches "/^TYPO3|TYPO3 linkvalidator/") and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/") and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/") @@ -149,6 +150,7 @@ services: request.getQueryParams()["topic_uid"] > 0 and not (context.getAspect("backend.user").isLoggedIn()) and not (context.getAspect("frontend.preview").isPreview()) + and request.getHeader("User-Agent")[0] and not (request.getHeader("User-Agent")[0] matches "/^TYPO3|TYPO3 linkvalidator/") and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/") and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/")