@@ 1890-1902 (lines=13) @@ | ||
1887 | if ( array_key_exists( $path, $tested_paths ) ) { |
|
1888 | $uploads['error'] = $tested_paths[ $path ]; |
|
1889 | } else { |
|
1890 | if ( ! wp_mkdir_p( $path ) ) { |
|
1891 | if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) { |
|
1892 | $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; |
|
1893 | } else { |
|
1894 | $error_path = basename( $uploads['basedir'] ) . $uploads['subdir']; |
|
1895 | } |
|
1896 | ||
1897 | $uploads['error'] = sprintf( |
|
1898 | /* translators: %s: directory path */ |
|
1899 | __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), |
|
1900 | esc_html( $error_path ) |
|
1901 | ); |
|
1902 | } |
|
1903 | ||
1904 | $tested_paths[ $path ] = $uploads['error']; |
|
1905 | } |
|
@@ 2160-2172 (lines=13) @@ | ||
2157 | $filename = wp_unique_filename( $upload['path'], $name ); |
|
2158 | ||
2159 | $new_file = $upload['path'] . "/$filename"; |
|
2160 | if ( ! wp_mkdir_p( dirname( $new_file ) ) ) { |
|
2161 | if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) |
|
2162 | $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir']; |
|
2163 | else |
|
2164 | $error_path = basename( $upload['basedir'] ) . $upload['subdir']; |
|
2165 | ||
2166 | $message = sprintf( |
|
2167 | /* translators: %s: directory path */ |
|
2168 | __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), |
|
2169 | $error_path |
|
2170 | ); |
|
2171 | return array( 'error' => $message ); |
|
2172 | } |
|
2173 | ||
2174 | $ifp = @ fopen( $new_file, 'wb' ); |
|
2175 | if ( ! $ifp ) |