* @return array See above for description.
*/
function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) {
* @return array See above for description.
*/
function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) {
- if ( ! is_array( $tested_paths ) ) {
- $tested_paths = array();
- }
-
- if ( ! in_array( $path, $tested_paths, true ) ) {
+ if ( array_key_exists( $path, $tested_paths ) ) {
+ $uploads['error'] = $tested_paths[ $path ];
+ } else {
if ( ! wp_mkdir_p( $path ) ) {
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
if ( ! wp_mkdir_p( $path ) ) {
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];