WordPress.org

Make WordPress Core

Ticket #11495: 11495.is_callable.diff

File 11495.is_callable.diff, 916 bytes (added by duck_, 3 years ago)
  • wp-admin/includes/update-core.php

     
    367367 
    368368        // Custom Content Directory needs updating now. 
    369369        // Copy Languages 
    370         if ( !is_wp_error($result) && $wp_filesystem->is_dir($from . $distro . 'wp-content/languages') ) { 
     370        if ( !is_wp_error($result) && is_callable( array($wp_filesystem, 'wp_lang_dir') ) && $wp_filesystem->is_dir($from . $distro . 'wp-content/languages') ) { 
    371371                if ( !@is_dir(WP_LANG_DIR) && 0 === strpos(WP_LANG_DIR, ABSPATH) ) { // Check the language directory exists first 
    372372                        $wp_filesystem->mkdir($to . str_replace(WP_LANG_DIR, ABSPATH, ''), FS_CHMOD_DIR); // If it's within the ABSPATH we can handle it here, otherwise they're out of luck. 
    373373                        clearstatcache(); // for FTP, Need to clear the stat cache