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.
This commit is contained in:
Daniel Siepmann 2022-04-14 10:13:30 +02:00
parent 6f7bda85ef
commit 2ba38e0e49

View file

@ -134,6 +134,7 @@ services:
$rule: > $rule: >
not (context.getAspect("backend.user").isLoggedIn()) not (context.getAspect("backend.user").isLoggedIn())
and not (context.getAspect("frontend.preview").isPreview()) 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 "/^TYPO3|TYPO3 linkvalidator/")
and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/") and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/")
and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/") and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/")
@ -149,6 +150,7 @@ services:
request.getQueryParams()["topic_uid"] > 0 request.getQueryParams()["topic_uid"] > 0
and not (context.getAspect("backend.user").isLoggedIn()) and not (context.getAspect("backend.user").isLoggedIn())
and not (context.getAspect("frontend.preview").isPreview()) 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 "/^TYPO3|TYPO3 linkvalidator/")
and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/") and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/")
and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/") and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/")