From 3ff3353aae398d9dc910b4bd5ee5490d217752ec Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 8 Oct 2021 10:24:46 +0200 Subject: [PATCH 1/8] Aufnahme von hacek-Sonderzeichen in Funktion covertProblemChars --- content/mitarbeiter/mitarbeiteroverlay.js.php | 13 ++++ include/functions.inc.php | 64 +++++++++++-------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/content/mitarbeiter/mitarbeiteroverlay.js.php b/content/mitarbeiter/mitarbeiteroverlay.js.php index b87a309f8..13a6d011c 100644 --- a/content/mitarbeiter/mitarbeiteroverlay.js.php +++ b/content/mitarbeiter/mitarbeiteroverlay.js.php @@ -2010,3 +2010,16 @@ function MitarbeiterUDFIFrameLoad() } catch(e) {} } + +// **** +// * Validierung Alias auf Sonderzeichen (analog zu checkWunschUid, außerdem . und _ erlaubt) +// **** +function checkAlias() +{ + var alias = document.getElementById('mitarbeiter-detail-textbox-alias').value; + + if (/^[a-z0-9 . _]*$/i.test(alias) === false) + { + alert('Der Alias darf keine Sonderzeichen enthalten'); + } +} diff --git a/include/functions.inc.php b/include/functions.inc.php index 587860982..8109a2035 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -455,42 +455,50 @@ function intersect($str1, $str2) * Konvertiert Problematische Sonderzeichen in Strings fuer * Accountnamen und EMail-Aliase * - * @param $str - * @return bereinigter String + * @param string $str Inputparameter. + * @return string bereinigter String. */ function convertProblemChars($str) { $enc = 'UTF-8'; $acentos = array( - 'A' => '/À|Á|Â|Ã|Å/', - 'Ae' => '/Ä/', - 'a' => '/à|á|â|ã|å/', - 'ae'=> '/ä/', - 'C' => '/Ç/', - 'c' => '/ç/', - 'E' => '/È|É|Ê|Ë/', - 'e' => '/è|é|ê|ë/', - 'I' => '/Ì|Í|Î|Ï/', - 'i' => '/ì|í|î|ï/', - 'N' => '/Ñ/', - 'n' => '/ñ/', - 'O' => '/Ò|Ó|Ô|Õ/', - 'Oe' => '/Ö/', - 'o' => '/ò|ó|ô|õ/', - 'oe' => '/ö/', - 'U' => '/Ù|Ú|Û/', - 'Ue' => '/Ü/', - 'u' => '/ù|ú|û/', - 'ue' => '/ü/', - 'Y' => '/Ý/', - 'y' => '/ý|ÿ/', - 'a.' => '/ª/', - 'o.' => '/º/', - 'ss' => '/ß/' + 'A' => '/À|Á|Â|Ã|Å|Ă|Ǎ/', + 'Ae' => '/Ä/', + 'a' => '/à|á|â|ã|å|ă|ǎ/', + 'ae' => '/ä/', + 'C' => '/Ç|Č/', + 'c' => '/ç|č/', + 'E' => '/È|É|Ê|Ë/', + 'e' => '/è|é|ê|ë/', + 'I' => '/Ì|Í|Î|Ï|Ǐ/', + 'i' => '/ì|í|î|ï|ǐ/', + 'N' => '/Ñ|Ň|ň/', + 'n' => '/ñ/', + 'O' => '/Ò|Ó|Ô|Õ|Ǒ/', + 'Oe' => '/Ö/', + 'o' => '/ò|ó|ô|õ|ǒ/', + 'oe' => '/ö/', + 'R' => '/Ř/', + 'r' => '/ř/', + 'S' => '/Š/', + 's' => '/š/', + 'T' => '/Ť/', + 't' => '/ť/', + 'U' => '/Ù|Ú|Û|Ŭ|Ǔ/', + 'Ue' => '/Ü/', + 'u' => '/ù|ú|û|ŭ|ǔ/', + 'ue' => '/ü/', + 'Y' => '/Ý/', + 'y' => '/ý|ÿ/', + 'Z' => '/Ž/', + 'z' => '/ž/', + 'a.' => '/ª/', + 'o.' => '/º/', + 'ss' => '/ß/' ); - return preg_replace($acentos, array_keys($acentos), htmlentities($str,ENT_NOQUOTES, $enc)); + return preg_replace($acentos, array_keys($acentos), htmlentities($str, ENT_NOQUOTES | ENT_HTML5, $enc)); } //Ersetzt alle Problemzeichen in einem String bevor dieser als xml oder rdf ausgegeben wird From 4f0b34137b3a943067094beba2785c7e6bb93f5a Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Mon, 11 Oct 2021 18:48:25 +0200 Subject: [PATCH 2/8] replacement of hatschek letters added in hlp_common_helper.php to be the same as in function.inc.php --- application/helpers/hlp_common_helper.php | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/application/helpers/hlp_common_helper.php b/application/helpers/hlp_common_helper.php index a7eda8827..7b937d73d 100644 --- a/application/helpers/hlp_common_helper.php +++ b/application/helpers/hlp_common_helper.php @@ -314,32 +314,40 @@ function sanitizeProblemChars($str) $enc = 'UTF-8'; $acentos = array( - 'A' => '/À|Á|Â|Ã|Å/', + 'A' => '/À|Á|Â|Ã|Å|Ă|Ǎ/', 'Ae' => '/Ä/', - 'a' => '/à|á|â|ã|å/', - 'ae'=> '/ä/', - 'C' => '/Ç/', - 'c' => '/ç/', + 'a' => '/à|á|â|ã|å|ă|ǎ/', + 'ae' => '/ä/', + 'C' => '/Ç|Č/', + 'c' => '/ç|č/', 'E' => '/È|É|Ê|Ë/', 'e' => '/è|é|ê|ë/', - 'I' => '/Ì|Í|Î|Ï/', - 'i' => '/ì|í|î|ï/', - 'N' => '/Ñ/', + 'I' => '/Ì|Í|Î|Ï|Ǐ/', + 'i' => '/ì|í|î|ï|ǐ/', + 'N' => '/Ñ|Ň|ň/', 'n' => '/ñ/', - 'O' => '/Ò|Ó|Ô|Õ/', + 'O' => '/Ò|Ó|Ô|Õ|Ǒ/', 'Oe' => '/Ö/', - 'o' => '/ò|ó|ô|õ/', + 'o' => '/ò|ó|ô|õ|ǒ/', 'oe' => '/ö/', - 'U' => '/Ù|Ú|Û/', + 'R' => '/Ř/', + 'r' => '/ř/', + 'S' => '/Š/', + 's' => '/š/', + 'T' => '/Ť/', + 't' => '/ť/', + 'U' => '/Ù|Ú|Û|Ŭ|Ǔ/', 'Ue' => '/Ü/', - 'u' => '/ù|ú|û/', + 'u' => '/ù|ú|û|ŭ|ǔ/', 'ue' => '/ü/', 'Y' => '/Ý/', 'y' => '/ý|ÿ/', + 'Z' => '/Ž/', + 'z' => '/ž/', 'a.' => '/ª/', 'o.' => '/º/', 'ss' => '/ß/' ); - return preg_replace($acentos, array_keys($acentos), htmlentities($str,ENT_NOQUOTES, $enc)); + return preg_replace($acentos, array_keys($acentos), htmlentities($str, ENT_NOQUOTES | ENT_HTML5, $enc)); } From 0c6f43f36ee4a98c0053336c4a01a24db489703e Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 4 Nov 2021 15:43:05 +0100 Subject: [PATCH 3/8] =?UTF-8?q?Check=20Alias=20auf=20Sonderzeichen=20bei?= =?UTF-8?q?=20=C3=84nderung=20Alias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/functions.js.php | 14 ++++++++++++++ .../mitarbeiter/mitarbeiterdetailoverlay.xul.php | 2 +- content/mitarbeiter/mitarbeiteroverlay.js.php | 13 ++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/content/functions.js.php b/content/functions.js.php index 55eed5414..f81fd26ec 100644 --- a/content/functions.js.php +++ b/content/functions.js.php @@ -419,3 +419,17 @@ function setVariable(variable, wert) return true; } } + +// **** +// * Validierung Alias auf Sonderzeichen (analog zu checkWunschUid, außerdem . und _ erlaubt) +// **** +function checkAlias(alias) +{ + + if (/^[a-z0-9 . _]*$/i.test(alias) === false) + { + return false; + } + else + return true; +} diff --git a/content/mitarbeiter/mitarbeiterdetailoverlay.xul.php b/content/mitarbeiter/mitarbeiterdetailoverlay.xul.php index 1cc8fb34e..c99a35c27 100644 --- a/content/mitarbeiter/mitarbeiterdetailoverlay.xul.php +++ b/content/mitarbeiter/mitarbeiterdetailoverlay.xul.php @@ -269,7 +269,7 @@ echo '';