Making WordPress.org


Ignore:
Timestamp:
01/09/2015 04:25:40 AM (12 years ago)
Author:
obenland
Message:

Theme Directory: Don't create a folder within a folder.

This prevents the temporary upload folder to duplicate the theme slug, going
from temp-dir/slug/slug/ to temp_dir/slug.

See ​https://themes.trac.wordpress.org/changeset/42066
See ​https://themes.trac.wordpress.org/changeset/42068

See #745.

File:
1 edited

Legend:

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

    r1115 r1116  
    273273        public function unwrap_package() {
    274274                $base_name = $this->get_sanitized_zip_name();
    275                 $tmp_dir   = "{$this->tmp_dir}/{$base_name}.zip";
     275                $zip_file  = "{$this->tmp_dir}/{$base_name}.zip";
    276276
    277277                // Move the uploaded zip in the temporary directory.
    278                 move_uploaded_file( $_FILES['zip_file']['tmp_name'], $tmp_dir );
     278                move_uploaded_file( $_FILES['zip_file']['tmp_name'], $zip_file );
    279279
    280280                $unzip     = escapeshellarg( self::UNZIP );
    281                 $tmp_dir   = escapeshellarg( $tmp_dir );
    282                 $theme_dir = escapeshellarg( "{$this->theme_dir}/" );
     281                $zip_file  = escapeshellarg( $zip_file );
     282                $tmp_dir   = escapeshellarg( $this->tmp_dir );
    283283
    284284                // Unzip it into the theme directory.
    285                 exec( escapeshellcmd( "{$unzip} {$tmp_dir} -d {$theme_dir}" ) );
     285                exec( escapeshellcmd( "{$unzip} {$zip_file} -d {$tmp_dir}" ) );
    286286        }
    287287
Note: See TracChangeset for help on using the changeset viewer.