From 0536ed87a2818166d04a59c4de2f6faf6e1e8c55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Dec 2020 21:38:33 +0100 Subject: [PATCH] Avoid to process too large user agent --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8813cb4daa9..890c16627aa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -154,6 +154,8 @@ function getBrowserInfo($user_agent) $os = 'unknown'; $phone = ''; + $user_agent = substr($user_agent, 0, 512); // Avoid to process too large user agent + $detectmobile = new Mobile_Detect(null, $user_agent); $tablet = $detectmobile->isTablet();