Make WordPress Core


Ignore:
Timestamp:
09/11/2012 10:06:49 PM (13 years ago)
Author:
nacin
Message:

Always return upload directory information from wp_upload_dir(), even if there is an error. Append the error to the array. see #19235.

File:
1 edited

Legend:

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

    r21818 r21822  
    224224    $new_path = $path;
    225225
    226     if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) {
    227         if ( 0 === strpos($new_path, $uploads['basedir']) ) {
    228                 $new_path = str_replace($uploads['basedir'], '', $new_path);
    229                 $new_path = ltrim($new_path, '/');
    230         }
     226    $uploads = wp_upload_dir();
     227    if ( 0 === strpos( $new_path, $uploads['basedir'] ) ) {
     228            $new_path = str_replace( $uploads['basedir'], '', $new_path );
     229            $new_path = ltrim( $new_path, '/' );
    231230    }
    232231
Note: See TracChangeset for help on using the changeset viewer.