Plugin Directory

Changeset 2165027


Ignore:
Timestamp:
09/29/2019 05:49:27 AM (6 years ago)
Author:
LABCAT
Message:

Implementing fix for bug where is incorrect when zipped folder continas a file with the same name.

Location:
processing-projects
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • processing-projects/tags/1.0.2/includes/class-ps-processing-project-meta-box.php

    r2082980 r2165027  
    113113                $zip = new ZipArchive;
    114114                if ($zip->open($file_upload->package) === true) {
    115                     $zipped_folder = $zip->getNameIndex(0);
     115                    $first_file = $zip->getNameIndex(0);
     116                    $zip_path = pathinfo( $first_file, PATHINFO_DIRNAME );
     117                    $zipped_folder = $zip_path === '.' ? $first_file : $zip_path . '/';
    116118                    $remote_destination = PROCESSING_PROJECTS_UPLOAD_DIR . $zipped_folder;
    117119                    $exiting_project = $wp_filesystem->exists($remote_destination);
  • processing-projects/tags/1.0.2/readme.txt

    r1854698 r2165027  
    11=== Processing Projects ===
    22Description: This plugin allows users to upload Processing Projects (in zip format) and easily add them throughout their website using shortcodes.
    3 Version: 1.0.1
     3Version: 1.0.2
    44Requires at least: 4.9.2
    55Tested up to: 4.9.2
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77Contributors: Shane Watters
    88Author URI: http://www.rocketship.co.nz
  • processing-projects/trunk/includes/class-ps-processing-project-meta-box.php

    r2082980 r2165027  
    113113                $zip = new ZipArchive;
    114114                if ($zip->open($file_upload->package) === true) {
    115                     $zipped_folder = $zip->getNameIndex(0);
     115                    $first_file = $zip->getNameIndex(0);
     116                    $zip_path = pathinfo( $first_file, PATHINFO_DIRNAME );
     117                    $zipped_folder = $zip_path === '.' ? $first_file : $zip_path . '/';
    116118                    $remote_destination = PROCESSING_PROJECTS_UPLOAD_DIR . $zipped_folder;
    117119                    $exiting_project = $wp_filesystem->exists($remote_destination);
  • processing-projects/trunk/readme.txt

    r1854698 r2165027  
    11=== Processing Projects ===
    22Description: This plugin allows users to upload Processing Projects (in zip format) and easily add them throughout their website using shortcodes.
    3 Version: 1.0.1
     3Version: 1.0.2
    44Requires at least: 4.9.2
    55Tested up to: 4.9.2
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77Contributors: Shane Watters
    88Author URI: http://www.rocketship.co.nz
Note: See TracChangeset for help on using the changeset viewer.