You are here

function transliteration_init in Transliteration 6

Same name and namespace in other branches
  1. 6.3 transliteration.module \transliteration_init()
  2. 6.2 transliteration.module \transliteration_init()
  3. 7.3 transliteration.module \transliteration_init()

Implementation of hook_init().

Transliterate and clean the names of files currently being uploaded.

File

./transliteration.module, line 31
Provides transliteration for UTF-8 text input and sanitzes file names.

Code

function transliteration_init() {
  if (!empty($_FILES['files'])) {
    require_once drupal_get_path('module', 'transliteration') . '/transliteration.inc';
    foreach ($_FILES['files']['name'] as $field => $filename) {
      $_FILES['files']['name'][$field] = transliteration_clean_filename($filename);
    }
  }
}