Ignore:
Timestamp:
Jun 7, 2006 5:35:16 AM (18 years ago)
Author:
scdev
Message:

Q - In the middle of working on the Prefs and Cache instantiation mode...can't decide to use singleton pattern or global vars. Updated ImageThumb? to allow filenames with path elements such as 01/23/4567_file.jpg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Upload.inc.php

    r146 r152  
    6363            if (isset($params['upload_path'])) {
    6464                $params['upload_path'] = realpath($params['upload_path']);
    65                 // Must be directory.
     65                // Source must be directory.
    6666                if (!is_dir($params['upload_path'])) {
    6767                    $app->logMsg(sprintf('Attempting to auto-create upload directory: %s', $params['upload_path']), LOG_NOTICE, __FILE__, __LINE__);
    68                     mkdir($params['upload_path'], $this->getParam('dest_dir_perms'));
     68                    if (phpversion() > '5') {
     69                        // Recursive.
     70                        mkdir($params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'), true);
     71                    } else {
     72                        mkdir($params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'));
     73                    }
    6974                    if (!is_dir($params['upload_path'])) {
    7075                        $app->logMsg(sprintf('Upload directory invalid: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__);
     
    7277                    }
    7378                }
    74                 // Must be writable.
     79                // Source must be writable.
    7580                if (!is_writable($params['upload_path'])) {
    7681                    $app->logMsg(sprintf('Upload directory not writable: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__);
Note: See TracChangeset for help on using the changeset viewer.