Ignore:
Timestamp:
Nov 7, 2012, 10:05:44 PM (11 years ago)
Author:
mistic100
Message:

small code cleaning, use mkgetdir(), add missing language string

Location:
extensions/BatchDownloader/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r18291 r18973  
    322322      foreach ($images_to_add as $row)
    323323      {       
    324         $zip->addFile(PHPWG_ROOT_PATH . $row['path'], $row['id'].'_'.get_filename_wo_extension($row['file']).'.'.get_extension($row['path']));
     324        $zip->addFile(PHPWG_ROOT_PATH . $row['path'], $row['id'].'_'.stripslashes(get_filename_wo_extension($row['file'])).'.'.get_extension($row['path']));
    325325       
    326326        array_push($images_added, $row['id']);
     
    437437      {
    438438          $out.= '<a href="'.add_url_params($url, array('set_id'=>$this->data['id'],'zip'=>$i)).'" rel="nofollow" style="font-weight:bold;"'
    439             .($i!=1 ? 'onClick="return confirm(\'Starting download Archive #'.$i.' will destroy Archive #'.($i-1).', be sure you finish the download. Continue ?\');"' : null).
     439            .($i!=1 ? ' onClick="return confirm(\''.addslashes(sprintf(l10n('Starting download Archive #%d will destroy Archive #%d, be sure you finish the download. Continue ?'), $i, $i-1)).'\');"' : null).
    440440            '><img src="'.$root_url.BATCH_DOWNLOAD_PATH.'template/drive_go.png"> Archive #'.$i.' (ready)</a>';
    441441      }
     
    460460    if (!file_exists(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/'))
    461461    {
    462       mkdir(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/', 0755, true);
     462      mkgetdir(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/');
    463463    }
    464464   
  • extensions/BatchDownloader/include/install.inc.php

    r17660 r18973  
    2828
    2929  // archives directory
    30   if ( file_exists($conf['data_location']) and !file_exists($conf['data_location'] . 'download_archives/') )
     30  if ( file_exists($conf['data_location']) )
    3131  {
    32     mkdir($conf['data_location'] . 'download_archives/', 0755);
     32    mkgetdir($conf['data_location'] . 'download_archives/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
    3333  }
    3434
Note: See TracChangeset for help on using the changeset viewer.