Skip to content
Snippets Groups Projects
Commit 35b8a638 authored by twistor's avatar twistor Committed by Chris Leppanen
Browse files

Issue #2515196 by twistor: Only transliterate downloaded files.

parent 1b14a060
No related branches found
No related tags found
No related merge requests found
...@@ -377,11 +377,6 @@ class FeedsEnclosure extends FeedsElement { ...@@ -377,11 +377,6 @@ class FeedsEnclosure extends FeedsElement {
$filename = rawurldecode(drupal_basename($filename)); $filename = rawurldecode(drupal_basename($filename));
if (module_exists('transliteration')) {
require_once drupal_get_path('module', 'transliteration') . '/transliteration.inc';
$filename = transliteration_clean_filename($filename);
}
// Remove leading and trailing whitespace and periods. // Remove leading and trailing whitespace and periods.
$filename = trim($filename, " \t\n\r\0\x0B."); $filename = trim($filename, " \t\n\r\0\x0B.");
...@@ -463,7 +458,14 @@ class FeedsEnclosure extends FeedsElement { ...@@ -463,7 +458,14 @@ class FeedsEnclosure extends FeedsElement {
$destination = trim($destination, '/') . '/'; $destination = trim($destination, '/') . '/';
} }
try { try {
$file = file_save_data($this->getContent(), $destination . $this->getLocalValue()); $filename = $this->getLocalValue();
if (module_exists('transliteration')) {
require_once drupal_get_path('module', 'transliteration') . '/transliteration.inc';
$filename = transliteration_clean_filename($filename);
}
$file = file_save_data($this->getContent(), $destination . $filename);
} }
catch (Exception $e) { catch (Exception $e) {
watchdog_exception('Feeds', $e, nl2br(check_plain($e))); watchdog_exception('Feeds', $e, nl2br(check_plain($e)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment