You are here

function data_taxonomy_sanitize in Data 6

Sanitize a term name depending on its vocabulary settings.

1 call to data_taxonomy_sanitize()
_data_taxonomy_save_terms in data_taxonomy/data_taxonomy.module
Helper function, saves a series of taxonomy terms for a record.

File

data_taxonomy/data_taxonomy.module, line 337
Hooks and API functions for Data Node module.

Code

function data_taxonomy_sanitize($name, $vid) {
  $vocabulary = taxonomy_vocabulary_load($vid);
  if ($vocabulary->tags) {

    // Make sure there aren't any terms with a comma (=tag delimiter) in it.
    return preg_replace('/\\s*,\\s*/', ' ', $name);
  }
  return $name;
}