Archive function can't write outside drupal files directory

jeremdow - February 4, 2009 - 15:26
Project:Ubercart EDI
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

uc_edi_archive_file uses the file_move api function, so you can't archive your edi files to a non-public folder in your home directory - even though you can export them there.

Using rename() instead of file_move() will fix this - as below:

function uc_edi_archive_file($filename = ''){
  $source = variable_get('uc_edi_order_export_dir', '') .'/'. $filename;
  $destination = variable_get('uc_edi_order_export_archive_dir', '') . $filename;
  if (rename($source, $destination)){
    drupal_set_message(t('Order EDI export file %file was archived successfully.', array('%file' => $filename)));
  }
  drupal_goto('admin/store/orders/edi/download');
}

AttachmentSize
uc_edi.archive.patch722 bytes

#1

jeremdow - February 4, 2009 - 17:03

oops - bad patch - reattached.

AttachmentSize
uc_edi.archive.patch 796 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.