Added transliteration to safe field name and safe type naming methods.

This commit is contained in:
2019-10-11 16:56:37 +02:00
parent 39b276ac4b
commit 548af56265
4 changed files with 10 additions and 2 deletions

View File

@ -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)