You are here

function uif_clean_value in User Import Framework 6

Same name and namespace in other branches
  1. 7 uif.admin.inc \uif_clean_value()

Check that input is UTF-8.

1 string reference to 'uif_clean_value'
uif_clean_and_key_row in ./uif.admin.inc
Trim all elements of $row, and pad $row out to the number of columns in the $header. Then replace keys in $row with $header values.

File

./uif.admin.inc, line 245
Simple, extensible user import from a CSV file.

Code

function uif_clean_value($value) {
  if (!drupal_validate_utf8($value)) {

    // Remove all chars except LF, CR, and basic ascii
    return preg_replace('/[^\\x0A\\x0D\\x20-\\x7E]/', '', $value);
  }
  return $value;
}