summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Mateescu2012-05-18 12:36:51 (GMT)
committer Andrei Mateescu2012-05-18 12:36:51 (GMT)
commit3616c908ed246a988df4a1119325d2dbf2542d21 (patch)
tree13d914c2d6e6ba9129aa9847a6733c30aeab97e5
parent6a53653bcf6129090666f1fa379a6829b343033c (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 bb1b7ac..2251a36 100644
--- a/transliteration.module
+++ b/transliteration.module
@@ -108,6 +108,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);