From 548af56265b3b217977a8a4d8cd362fb82997bb9 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 11 Oct 2019 16:56:37 +0200 Subject: [PATCH] Added transliteration to safe field name and safe type naming methods. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/componentbuilder.php | 4 ++++ site/helpers/componentbuilder.php | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fddd67048..386c6d17f 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ TODO + *Version*: 2.10.1 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **253747** ++ *Line count*: **253755** + *Field count*: **1347** + *File count*: **1618** + *Folder count*: **261** diff --git a/admin/README.txt b/admin/README.txt index fddd67048..386c6d17f 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -150,7 +150,7 @@ TODO + *Version*: 2.10.1 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **253747** ++ *Line count*: **253755** + *Field count*: **1347** + *File count*: **1618** + *Folder count*: **261** diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 745943994..b4ee4d435 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -697,6 +697,8 @@ abstract class ComponentbuilderHelper $string = trim($string); $string = preg_replace('/'.$spacer.'+/', ' ', $string); $string = preg_replace('/\s+/', ' ', $string); + // Transliterate string + $string = self::transliterate($string); // remove all and keep only characters and numbers $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string); // replace white space with underscore (SAFEST OPTION) @@ -751,6 +753,8 @@ abstract class ComponentbuilderHelper { $string = self::replaceNumbers($string); } + // Transliterate string + $string = self::transliterate($string); // remove all and keep only characters and numbers and point (TODO just one point) $string = trim(preg_replace("/[^A-Za-z0-9\.]/", '', $string)); // best is to return lower (for all string equality in compiler) diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index dce9afd3b..b5239c5b7 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -697,6 +697,8 @@ abstract class ComponentbuilderHelper $string = trim($string); $string = preg_replace('/'.$spacer.'+/', ' ', $string); $string = preg_replace('/\s+/', ' ', $string); + // Transliterate string + $string = self::transliterate($string); // remove all and keep only characters and numbers $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string); // replace white space with underscore (SAFEST OPTION) @@ -751,6 +753,8 @@ abstract class ComponentbuilderHelper { $string = self::replaceNumbers($string); } + // Transliterate string + $string = self::transliterate($string); // remove all and keep only characters and numbers and point (TODO just one point) $string = trim(preg_replace("/[^A-Za-z0-9\.]/", '', $string)); // best is to return lower (for all string equality in compiler)