IF copy fails, chmod target to 0644 and try again

git-svn-id: https://develop.svn.wordpress.org/trunk@9493 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-11-03 17:16:41 +00:00
parent 6f5222b2a5
commit 20addd1346
2 changed files with 10 additions and 2 deletions

View File

@@ -542,8 +542,12 @@ function copy_dir($from, $to) {
foreach ( (array) $dirlist as $filename => $fileinfo ) {
if ( 'f' == $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) )
return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) {
// If copy failed, chmod file to 0644 and try again.
$wp_filesystem->chmod($to . $filename, 0644);
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) )
return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
}
$wp_filesystem->chmod($to . $filename, 0644);
} elseif ( 'd' == $fileinfo['type'] ) {
if ( !$wp_filesystem->is_dir($to . $filename) ) {

View File

@@ -1290,6 +1290,10 @@ table.form-table td .updated {
/* Post Screen */
#normal-sortables {
min-height: 50px;
}
.postbox {
position: relative;
min-width: 255px;