Code Duplication    Length = 12-13 lines in 2 locations

class/Utility.php 1 location

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

include/functions.php 1 location

@@ 736-747 (lines=12) @@
733
    return true;
734
}
735
736
function lx_sanitizeFieldName($field) {
737
    $field = lx_removeAccents($field);
738
    $field = strtolower($field);
739
    $field = preg_replace('/&.+?;/', '', $field); // kill entities
740
    $field = preg_replace('/[^a-z0-9 _-]/', '', $field);
741
    $field = preg_replace('/\s+/', ' ', $field);
742
    $field = str_replace(' ', '-', $field);
743
    $field = preg_replace('|-+|', '-', $field);
744
    $field = trim($field, '-');
745
746
    return $field;
747
}
748
749
// Verify that a term does not exist for submissions and requests (both user frontend and admin backend)
750
function lx_TermExists($term, $table) {