From f354245a1dba4160e8a740fe2c50128061ffad70 Mon Sep 17 00:00:00 2001 From: jennylee Date: Wed, 11 Jun 2014 12:58:26 -0400 Subject: [PATCH] BUG-13874 Duplicate typing for dynaforms over IE 11 When a dynaform has some fields with validations, when typing some data was duplicated. I added a validation to detect IE version, if this is 11 a meta tag is added in the HTML (). This tag let the browser use the IE8 compatibility and prevent the duplicated characters issue. The validation for IE 11 is a preg_match php function searching a 'Trident/' string. This is diferent in IE10, where the User-agent has MSIE on it. On IE 11 MSIE was deleted and the only way to detect that the browser is IE11 is searching 'Trident/'. --- workflow/engine/skinEngine/skinEngine.php | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/workflow/engine/skinEngine/skinEngine.php b/workflow/engine/skinEngine/skinEngine.php index 8818edc09..1c968b66b 100755 --- a/workflow/engine/skinEngine/skinEngine.php +++ b/workflow/engine/skinEngine/skinEngine.php @@ -270,8 +270,13 @@ class SkinEngine $meta = null; $dirBody = null; - if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) { - $ie = intval($arrayMatch[1]); + if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\(.*Trident.(\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) { + + //Get the IE version + if(preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch) || preg_match("/^.*\(.*rv.(\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)){ + $ie = intval($arrayMatch[1]); + } + $swTrident = (preg_match("/^.*Trident.*$/", $_SERVER["HTTP_USER_AGENT"]))? 1 : 0; //Trident only in IE8+ $sw = 1; @@ -279,9 +284,10 @@ class SkinEngine if ((($ie == 7 && $swTrident == 1) || $ie == 8) && !preg_match("/^ux.+$/", SYS_SKIN)) { //IE8 $sw = 0; } - + + if ($sw == 1) { - if ($ie == 10) { + if ($ie == 10 || $ie == 11 ) { $ie = 8; } @@ -652,10 +658,14 @@ class SkinEngine $meta = null; $header = null; - if (preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) { - $ie = intval($arrayMatch[1]); - - if ($ie == 10) { + if (preg_match("/^.*\(.*Trident.(\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) { + + //Get the IE version + if(preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch) || preg_match("/^.*\(.*rv.(\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)){ + $ie = intval($arrayMatch[1]); + } + + if ($ie == 10 || $ie == 11) { $ie = 8; $meta = "";