summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Mateescu2012-05-18 12:36:23 (GMT)
committer Andrei Mateescu2012-05-18 12:36:23 (GMT)
commit4795bd57eb486b3cc9c417e80d96d89331531669 (patch)
treea98b490ef83b3dcbe1f3d53e28966a9798a9c71b
parentee9b55e9c523db9262078538d617148850dd532a (diff)
Issue #835598 by smk-ka: Remove multiple consecutive non-alphabetical characters.
-rw-r--r--transliteration.module2
1 files changed, 2 insertions, 0 deletions
diff --git a/transliteration.module b/transliteration.module
index 5fc889c..0e9cf05 100644
--- a/transliteration.module
+++ b/transliteration.module
@@ -107,6 +107,8 @@ function transliteration_clean_filename($filename, $source_langcode = NULL) {
$filename = str_replace(' ', '_', $filename);
// Remove remaining unsafe characters.
$filename = preg_replace('![^0-9A-Za-z_.-]!', '', $filename);
+ // Remove multiple consecutive non-alphabetical characters.
+ $filename = preg_replace('/(_)_+|(\.)\.+|(-)-+/', '\\1\\2\\3', $filename);
// Force lowercase to prevent issues on case-insensitive file systems.
if (variable_get('transliteration_file_lowercase', TRUE)) {
$filename = strtolower($filename);