Make WordPress Core

Changeset 3390


Ignore:
Timestamp:
01/02/2006 04:59:39 AM (19 years ago)
Author:
ryan
Message:

Create dir hierarchy for files passed to wp_upload_bits().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-post.php

    r3389 r3390  
    941941       
    942942    $new_file = $upload['path'] . "/$filename";
     943    if ( ! wp_mkdir_p( dirname($new_file) ) ) {
     944        $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file));
     945        return array('error' => $message);
     946    }
     947
    943948    $ifp = @ fopen($new_file, 'wb');
    944949    if ( ! $ifp )
Note: See TracChangeset for help on using the changeset viewer.