| @@ 1302-1314 (lines=13) @@ | ||
| 1299 | * @param $field |
|
| 1300 | * @return mixed|string |
|
| 1301 | */ |
|
| 1302 | public static function sanitizeFieldName($field) |
|
| 1303 | { |
|
| 1304 | $field = LexikonUtility::removeAccents($field); |
|
| 1305 | $field = strtolower($field); |
|
| 1306 | $field = preg_replace('/&.+?;/', '', $field); // kill entities |
|
| 1307 | $field = preg_replace('/[^a-z0-9 _-]/', '', $field); |
|
| 1308 | $field = preg_replace('/\s+/', ' ', $field); |
|
| 1309 | $field = str_replace(' ', '-', $field); |
|
| 1310 | $field = preg_replace('|-+|', '-', $field); |
|
| 1311 | $field = trim($field, '-'); |
|
| 1312 | ||
| 1313 | return $field; |
|
| 1314 | } |
|
| 1315 | ||
| 1316 | // Verify that a term does not exist for submissions and requests (both user frontend and admin backend) |
|
| 1317 | /** |
|
| @@ 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) { |
|