Making WordPress.org


Ignore:
Timestamp:
02/06/2016 10:03:47 AM (8 years ago)
Author:
Otto42
Message:

Fix permissions and dates for uploaded theme ZIP files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r1910 r2475  
    337337
    338338        // Unzip it into the theme directory.
    339         exec( escapeshellcmd( "{$unzip} {$zip_file} -d {$tmp_dir}/{$base_name}" ) );
     339        exec( escapeshellcmd( "{$unzip} -DD {$zip_file} -d {$tmp_dir}/{$base_name}" ) );
     340
     341        // Fix any permissions issues with the files. Sets 755 on directories, 644 on files
     342        exec( escapeshellcmd( "chmod -R 755 {$tmp_dir}/{$base_name}" ) );
     343        exec( escapeshellcmd( "find {$tmp_dir}/{$base_name} -type f -print0" ) . ' | xargs -I% -0 chmod 644 %' );
    340344    }
    341345
Note: See TracChangeset for help on using the changeset viewer.