From cae8c3603758cff7a75d8bbb3b5d15bae38e5692 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 12 May 2013 16:03:48 +0530 Subject: [PATCH] [ticket/10820] fix regex Extract IE version from user agent string and then compare it with 7 PHPBB3-10820 --- phpBB/download/file.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 2568455e53..d9ebaa4281 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -718,7 +718,15 @@ function file_gc() */ function phpbb_is_greater_ie7($user_agent) { - return (bool) preg_match('/msie [^67]+\\.*;/', strtolower($user_agent)); + if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches)) + { + $ie_version = (int) $matches[1]; + return ($ie_version > 7); + } + else + { + return false; + } } ?> \ No newline at end of file