Ticket #34359: 34359.6.patch
File 34359.6.patch, 1.0 KB (added by , 7 years ago) |
---|
-
src/wp-includes/functions.php
1875 1875 $tested_paths = array(); 1876 1876 } 1877 1877 1878 if ( array_key_exists( $path, $tested_paths ) ) { 1879 $uploads['error'] = $tested_paths[ $path ]; 1880 } else { 1878 if ( ! in_array( $path, $tested_paths, true ) ) { 1881 1879 if ( ! wp_mkdir_p( $path ) ) { 1882 1880 if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) { 1883 1881 $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; … … 1886 1884 } 1887 1885 1888 1886 $uploads['error'] = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $error_path ) ); 1887 } else { 1888 $tested_paths[] = $path; 1889 wp_cache_set( 'upload_dir_tested_paths', $tested_paths ); 1889 1890 } 1890 1891 $tested_paths[ $path ] = $uploads['error'];1892 wp_cache_set( 'upload_dir_tested_paths', $tested_paths );1893 1891 } 1894 1892 } 1895 1893