fs_connect() fixes. Props dd32. fixes #10541
git-svn-id: http://svn.automattic.com/wordpress/trunk@11862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
91bc15b495
commit
5787c17206
|
@ -81,20 +81,28 @@ class WP_Upgrader {
|
||||||
return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
|
return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
|
||||||
|
|
||||||
foreach ( (array)$directories as $dir ) {
|
foreach ( (array)$directories as $dir ) {
|
||||||
if ( ABSPATH == $dir && ! $wp_filesystem->abspath() )
|
switch ( $dir ) {
|
||||||
return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
|
case ABSPATH:
|
||||||
|
if ( ! $wp_filesystem->abspath() )
|
||||||
elseif ( WP_CONTENT_DIR == $dir && ! $wp_filesystem->wp_content_dir() )
|
return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
|
||||||
return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
|
break;
|
||||||
|
case WP_CONTENT_DIR:
|
||||||
elseif ( WP_PLUGIN_DIR == $dir && ! $wp_filesystem->wp_plugins_dir() )
|
if ( ! $wp_filesystem->wp_content_dir() )
|
||||||
return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
|
return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
|
||||||
|
break;
|
||||||
elseif ( WP_CONTENT_DIR . '/themes' == $dir && ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
|
case WP_PLUGIN_DIR:
|
||||||
return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
|
if ( ! $wp_filesystem->wp_plugins_dir() )
|
||||||
|
return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
|
||||||
elseif ( ! $wp_filesystem->find_folder($dir) )
|
break;
|
||||||
return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
|
case WP_CONTENT_DIR . '/themes':
|
||||||
|
if ( ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
|
||||||
|
return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if ( ! $wp_filesystem->find_folder($dir) )
|
||||||
|
return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} //end fs_connect();
|
} //end fs_connect();
|
||||||
|
|
Loading…
Reference in New Issue