Commit 357164fe authored by git's avatar git Committed by renatog
Browse files

Issue #3069643 by robert-os, RenatoG: Ability to alter file names after processing

parent d0e015f0
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -19,3 +19,18 @@ function hook_transliteration_clean_filename_prepare_alter(&$filename, $source_l
  $filename = drupal_strtolower($filename);
  $filename = str_ireplace(array('& ', '& '), 'and ', $filename);
}

/**
 * Alters a file name after transliteration and sanitization.
 *
 * @param string &$filename
 *   The file name after being parsed by transliteration.
 * @param string $source_langcode
 *   Optional ISO 639 language code that denotes the language of the input.
 *
 * @see transliteration_clean_filename()
 */
function hook_transliteration_clean_filename_alter(&$filename, $source_langcode) {
  $filename = drupal_strtolower($filename);
  $filename = str_ireplace(array('& ', '& '), 'and ', $filename);
}
+3 −0
Original line number Diff line number Diff line
@@ -164,6 +164,9 @@ function transliteration_clean_filename($filename, $source_langcode = NULL) {
  if (variable_get('transliteration_file_lowercase', TRUE)) {
    $filename = drupal_strtolower($filename);
  }
  // Allow other modules to alter the filename after processing.
  drupal_alter('transliteration_clean_filename', $filename, $source_langcode);

  return $filename;
}