@@ 1891-1899 (lines=9) @@ | ||
1888 | if ( array_key_exists( $path, $tested_paths ) ) { |
|
1889 | $uploads['error'] = $tested_paths[ $path ]; |
|
1890 | } else { |
|
1891 | if ( ! wp_mkdir_p( $path ) ) { |
|
1892 | if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) { |
|
1893 | $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; |
|
1894 | } else { |
|
1895 | $error_path = basename( $uploads['basedir'] ) . $uploads['subdir']; |
|
1896 | } |
|
1897 | ||
1898 | $uploads['error'] = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $error_path ) ); |
|
1899 | } |
|
1900 | ||
1901 | $tested_paths[ $path ] = $uploads['error']; |
|
1902 | } |
|
@@ 2154-2162 (lines=9) @@ | ||
2151 | $filename = wp_unique_filename( $upload['path'], $name ); |
|
2152 | ||
2153 | $new_file = $upload['path'] . "/$filename"; |
|
2154 | if ( ! wp_mkdir_p( dirname( $new_file ) ) ) { |
|
2155 | if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) |
|
2156 | $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir']; |
|
2157 | else |
|
2158 | $error_path = basename( $upload['basedir'] ) . $upload['subdir']; |
|
2159 | ||
2160 | $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $error_path ); |
|
2161 | return array( 'error' => $message ); |
|
2162 | } |
|
2163 | ||
2164 | $ifp = @ fopen( $new_file, 'wb' ); |
|
2165 | if ( ! $ifp ) |