? 916962-1_reschedule.patch
? 916962-4_reschedule.patch
? 919172-1_dont_delete.patch
? 919172-2_dont_delete.patch
? libraries/simplepie.inc
? tests/.DS_Store
Index: plugins/FeedsParser.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsParser.inc,v
retrieving revision 1.22
diff -u -p -r1.22 FeedsParser.inc
--- plugins/FeedsParser.inc	15 Sep 2010 16:44:50 -0000	1.22
+++ plugins/FeedsParser.inc	22 Sep 2010 13:44:41 -0000
@@ -197,18 +197,28 @@ class FeedsEnclosure extends FeedsElemen
   protected $file;
 
   /**
+   * Delete flag, denoting whether a file should be deleted when this object
+   * is destroyed.
+   *
+   * @see __destruct()
+   * @see getFile()
+   */
+  protected $delete_file;
+
+  /**
    * Constructor, requires MIME type.
    */
   public function __construct($value, $mime_type) {
     parent::__construct($value);
     $this->mime_type = $mime_type;
+    $this->delete_file = FALSE;
   }
 
   /**
    * Destructor, clean up any temporary files.
    */
   public function __destruct() {
-    if (!empty($this->file)) {
+    if (!empty($this->file) && $this->delete_file) {
       file_delete($this->file);
     }
   }
@@ -270,6 +280,7 @@ class FeedsEnclosure extends FeedsElemen
       if ($this->file === 0) {
         throw new Exception(t('Cannot write content to %dest', array('%dest' => $dest)));
       }
+      $this->delete_file = TRUE;
     }
     return $this->file;
   }
