| @@ 888-899 (lines=12) @@ | ||
| 885 | return true; |
|
| 886 | } |
|
| 887 | ||
| 888 | function lx_sanitizeFieldName($field) { |
|
| 889 | $field = lx_removeAccents($field); |
|
| 890 | $field = strtolower($field); |
|
| 891 | $field = preg_replace('/&.+?;/', '', $field); // kill entities |
|
| 892 | $field = preg_replace('/[^a-z0-9 _-]/', '', $field); |
|
| 893 | $field = preg_replace('/\s+/', ' ', $field); |
|
| 894 | $field = str_replace(' ', '-', $field); |
|
| 895 | $field = preg_replace('|-+|', '-', $field); |
|
| 896 | $field = trim($field, '-'); |
|
| 897 | ||
| 898 | return $field; |
|
| 899 | } |
|
| 900 | ||
| 901 | // Verify that a term does not exist for submissions and requests (both user frontend and admin backend) |
|
| 902 | function lx_TermExists($term, $table) { |
|
| @@ 1322-1334 (lines=13) @@ | ||
| 1319 | * @param $field |
|
| 1320 | * @return mixed|string |
|
| 1321 | */ |
|
| 1322 | public static function sanitizeFieldName($field) |
|
| 1323 | { |
|
| 1324 | $field = LexikonUtility::removeAccents($field); |
|
| 1325 | $field = strtolower($field); |
|
| 1326 | $field = preg_replace('/&.+?;/', '', $field); // kill entities |
|
| 1327 | $field = preg_replace('/[^a-z0-9 _-]/', '', $field); |
|
| 1328 | $field = preg_replace('/\s+/', ' ', $field); |
|
| 1329 | $field = str_replace(' ', '-', $field); |
|
| 1330 | $field = preg_replace('|-+|', '-', $field); |
|
| 1331 | $field = trim($field, '-'); |
|
| 1332 | ||
| 1333 | return $field; |
|
| 1334 | } |
|
| 1335 | ||
| 1336 | // Verify that a term does not exist for submissions and requests (both user frontend and admin backend) |
|
| 1337 | /** |
|