Skip to content

Commit

Permalink
add comments in code for #61 to support characters
Browse files Browse the repository at this point in the history
  • Loading branch information
creecros committed Feb 9, 2021
1 parent 8e8673c commit 9e15c20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controller/MetadataTypesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function validateValues($values)
private function createMachineName($human_name = '')
{
$machine_name = strtolower($human_name);
// Remove special characters
// Remove special characters (remove the below line to support non latin characters)
$machine_name = preg_replace('/[^a-z0-9_\s-]/', '', $machine_name);
// Cleanup multiple dashes or whitespaces
$machine_name = preg_replace('/[\s-]+/', ' ', $machine_name);
Expand Down Expand Up @@ -127,7 +127,7 @@ private function beautyName($human_name = '')

private function fixHumanName($human_name = '')
{
// Remove special characters
// Remove special characters (remove the below line to support non latin characters)
$human_name = preg_replace('/[^A-Za-z0-9_\s-]/', '', $human_name);
// Cleanup multiple dashes or whitespaces
$human_name = preg_replace('/[\s-]+/', ' ', $human_name);
Expand Down

0 comments on commit 9e15c20

Please sign in to comment.