Changeset 3001

Show
Ignore:
Timestamp:
07/08/2008 09:10:28 AM (5 months ago)
Author:
Shadowhand
Message:

Fixing #664, thanks ae.

Location:
trunk/system
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/config/upload.php

    r2369 r3001  
    88 
    99/** 
     10 * Enable or disable directory creation. 
     11 */ 
     12$config['create_directories'] = FALSE; 
     13 
     14/** 
    1015 * Remove spaces from uploaded filenames. 
    1116 */ 
  • trunk/system/helpers/upload.php

    r2906 r3001  
    3333                } 
    3434 
    35                 if (Config::item('upload.remove_spaces')) 
     35                if (Config::item('upload.remove_spaces') === TRUE) 
    3636                { 
    3737                        // Remove spaces from the filename 
     
    4747                // Make sure the directory ends with a slash 
    4848                $directory = rtrim($directory, '/').'/'; 
     49 
     50                if ( ! file_exists($directory) AND Config::item('upload.create_directories') === TRUE) 
     51                { 
     52                        // Create the upload directory 
     53                        mkdir($directory, 0777, TRUE); 
     54                } 
    4955 
    5056                if ( ! is_writable($directory))