diff --git a/plugins/FeedsParser.inc b/plugins/FeedsParser.inc
index 1e1d329..3d81a00 100644
--- a/plugins/FeedsParser.inc
+++ b/plugins/FeedsParser.inc
@@ -371,11 +371,7 @@ class FeedsEnclosure extends FeedsElement {
       return $this->safeFilename;
     }
 
-    // Strip any query string or fragment from file name.
-    list($filename) = explode('?', $this->getValue());
-    list($filename) = explode('#', $filename);
-
-    $filename = rawurldecode(drupal_basename($filename));
+    $filename = rawurldecode(drupal_basename($this->getValue()));
 
     // Remove leading and trailing whitespace and periods.
     $filename = trim($filename, " \t\n\r\0\x0B.");
diff --git a/tests/feeds_mapper_file.test b/tests/feeds_mapper_file.test
index 6138be0..2cb5acd 100644
--- a/tests/feeds_mapper_file.test
+++ b/tests/feeds_mapper_file.test
@@ -267,14 +267,6 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
       $message = t('The file @file has an invalid extension.', array('@file' => $filename));
       $this->assertTrue(db_query("SELECT 1 FROM {watchdog} WHERE message = :message", array(':message' => $message))->fetchField());
     }
-
-    // Test that query string and fragments are removed.
-    $enclosure = new FeedsEnclosure('http://example.com/image.jpg?thing=stuff', 'text/plain');
-    $this->assertEqual($enclosure->getLocalValue(), 'image.jpg');
-    $enclosure = new FeedsEnclosure('http://example.com/image.jpg#stuff', 'text/plain');
-    $this->assertEqual($enclosure->getLocalValue(), 'image.jpg');
-    $enclosure = new FeedsEnclosure('http://example.com/image.JPG?thing=stuff#stuff', 'text/plain');
-    $this->assertEqual($enclosure->getLocalValue(), 'image.JPG');
   }
 
   /**
