WordPress.org

Make WordPress Core

Changeset 16996


Ignore:
Timestamp:
12/16/10 10:20:12 (4 years ago)
Author:
westi
Message:

Check for the wp-admin/imports folder before we open it so we don't show notices when it isn't there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import.php

    r16994 r16996  
    5959// Load all importers so that they can register. 
    6060$import_loc = 'wp-admin/import'; 
    61 $import_root = ABSPATH.$import_loc; 
    62 $imports_dir = @ opendir($import_root); 
    63 if ($imports_dir) { 
    64     while (($file = readdir($imports_dir)) !== false) { 
    65         if ($file[0] == '.') { 
    66             continue; 
    67         } elseif (substr($file, -4) == '.php') { 
    68             require_once($import_root . '/' . $file); 
     61$import_root = ABSPATH . $import_loc; 
     62 
     63if ( file_exists( $import_root ) ) { 
     64    $imports_dir = opendir($import_root); 
     65    if ($imports_dir) { 
     66        while (($file = readdir($imports_dir)) !== false) { 
     67            if ($file[0] == '.') { 
     68                continue; 
     69            } elseif (substr($file, -4) == '.php') { 
     70                require_once($import_root . '/' . $file); 
     71            } 
    6972        } 
    7073    } 
     74    closedir( $imports_dir ); 
    7175} 
    72 @closedir($imports_dir); 
    7376 
    7477$importers = get_importers(); 
Note: See TracChangeset for help on using the changeset viewer.