Plugin Directory

Changeset 1904483


Ignore:
Timestamp:
07/05/2018 11:12:21 AM (8 years ago)
Author:
spreadsheetconverter
Message:

v10.0.2 : rename the package zip automatically if its name contains any space or special characters such as &, (, ) etc.

Location:
import-spreadsheets-from-microsoft-excel
Files:
33 added
3 edited

Legend:

Unmodified
Added
Removed
  • import-spreadsheets-from-microsoft-excel/trunk/debug.txt

    r1896446 r1904483  
    2626[June 19, 2018] There was a problem with the upload.
    2727[June 19, 2018] There was a problem with the upload.
     28[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     29[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     30[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     31[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     32[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     33[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
     34[June 29, 2018] You need version 10 of Wordpress Plugin for upload process
  • import-spreadsheets-from-microsoft-excel/trunk/import-spreadsheets-from-microsoft-excel.php

    r1896446 r1904483  
    55Plugin URI: https://www.spreadsheetconverter.com/support/online-help/help-wordpress-plugin-to-import-spreadsheets-from-microsoft-excel
    66Description: Import Spreadsheets from Microsoft Excel
    7 Version: 10.0.1
     7Version: 10.0.2
    88Author: SpreadsheetConverter
    99Author URI: http://www.spreadsheetconverter.com   
     
    1616************************************************************************************
    1717
    18 Copyright (C) 2017  SpreadsheetConverter, http://www.spreadsheetconverter.com
     18Copyright (C) 2018  SpreadsheetConverter, http://www.spreadsheetconverter.com
    1919
    2020This program is free software: you can redistribute it and/or modify
     
    311311
    312312    $html  = '<div class="errorMessage"  class="messageBox messageError"></div><p class="description">';
    313     $html .= __( 'Please upload the package created by the SpreadsheetConverter. To create the package, go to Excel > SpreadsheetConverter Ribbon > Share menu > WordPress Share.', 'SpreadsheetConverter' );
     313    $html .= __( 'Please upload the package created by the SpreadsheetConverter. To create the package, go to Excel > SpreadsheetConverter Ribbon > Publish section > WordPress Plugin.', 'SpreadsheetConverter' );
    314314    $html .= '</p>';
    315315    $html .= '<div style="position:relative"><div class="uploadFileWrapper">       
     
    396396    //file name is compactible with sanitize_file_name() function
    397397    //plugin functional requirement 
    398     if( sanitize_file_name( $_FILES['wp_custom_attachment']['name'] ) != $_FILES['wp_custom_attachment']['name'] ){
     398    // if( sanitize_file_name( $_FILES['wp_custom_attachment']['name'] ) != $_FILES['wp_custom_attachment']['name'] ){
    399399       
    400         set_transient( 'ims-fme-ssc-admin-notice-plug-special-char' , $_FILES['wp_custom_attachment']['name']);
     400    //     set_transient( 'ims-fme-ssc-admin-notice-plug-special-char' , $_FILES['wp_custom_attachment']['name']);
    401401       
    402         // unhook this function to prevent indefinite loop
    403         remove_action( 'save_post', 'ims_fme_ssc_save_custom_meta_data' );
    404         wp_update_post( array('ID' => intval( $id ), 'post_status' => 'draft') );
    405         add_action( 'save_post', 'ims_fme_ssc_save_custom_meta_data' );
    406 
    407         return $id;
    408     }
     402    //     // unhook this function to prevent infinite loop
     403    //     remove_action( 'save_post', 'ims_fme_ssc_save_custom_meta_data' );
     404    //     wp_update_post( array('ID' => intval( $id ), 'post_status' => 'draft') );
     405    //     add_action( 'save_post', 'ims_fme_ssc_save_custom_meta_data' );
     406
     407    //     return $id;
     408    // }
    409409
    410410    $folder_name    = basename( sanitize_file_name( $_FILES['wp_custom_attachment']['name'] ),".zip" );
     
    438438                if ( $pathall[0] == $folder_name ) {
    439439                    $pub_dir = $pub_dir;
     440                    $rename = false;
    440441                }elseif($pathall[0] != $folder_name){
    441                      $pub_dir = $pub_dir."/".$folder_name;
     442                     //$pub_dir = $pub_dir."/".$folder_name;
     443                     $pub_dir = $pub_dir;
     444                     $rename = true;
     445
     446
    442447                }
    443448                // change this to the correct site path
    444                 $zip->extractTo( $pub_dir.'/');
     449                $zip->extractTo( $pub_dir.'/');
     450               
     451                if ( true === $rename ){
     452                    //rename folder to sanitize name
     453                    rename( $pub_dir .'/'. $pathall[0] , $pub_dir .'/'. sanitize_file_name( $pathall[0] ) );
     454
     455                    //reanme file to sanitize name
     456                    if( file_exists( $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. $pathall[0] . '.htm'  ) ) {
     457                        $oldname = $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. $pathall[0] . '.htm';
     458                        $sanitize_name = $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. sanitize_file_name( $pathall[0] ) . '.htm';
     459                        copy( $oldname ,  $sanitize_name );
     460                        wp_delete_file( $oldname );
     461                    }
     462
     463                }
     464
    445465                $zip->close();
    446466                unlink($target_path);
     
    587607        delete_transient( 'ims-fme-ssc-admin-notice-zip-error' );
    588608   
    589     }elseif( get_transient( 'ims-fme-ssc-admin-notice-plug-special-char' ) ) { ?>
     609    }/*elseif( get_transient( 'ims-fme-ssc-admin-notice-plug-special-char' ) ) { ?>
    590610        <div class="updated" style="color:red"><p>Invalid name <?php echo get_transient( 'ims-fme-ssc-admin-notice-plug-special-char' ); ?></p></div>
    591611    <?php
    592612        delete_transient( 'ims-fme-ssc-admin-notice-plug-special-char' );
    593     }
     613    }*/
    594614
    595615}
     
    641661                  jQuery('[id^=\"wp_custom_attachment\"]').css('background', '#F96');
    642662                  setTimeout(\"jQuery('#ajax-loading').css('visibility', 'hidden');\", 100);
    643                   alert('You need SpreadsheetConverter version 10 Professional Edition to benefit from the simple convenience of the spreadsheet upload plugin.');
     663                  alert('Please upload the zip file');
    644664                  setTimeout(\"jQuery('#publish').removeClass('button-primary-disabled');\", 100);
    645665                  return false;
  • import-spreadsheets-from-microsoft-excel/trunk/readme.txt

    r1898260 r1904483  
    77Tested up to: 4.9
    88Requires PHP: 5.2.4
    9 Stable tag: 10.0.1
     9Stable tag: 10.0.2
    1010
    1111Import live, calculating spreadsheets from Microsoft Excel to WordPress. The uploaded online spreadsheet is live, and looks and feels like in Excel.
     
    215215== Changelog ==
    216216
     217= 10.0.2 =
     218
     219* line 396 to 408 : commented sanitization file check because all folder/file are renamed accordingly
     220* line 451 to 461 : added to rename folder, file and to delete unsanitized filename
     221* line 609 to 613 : commented message invalid file name
     222
    217223= 10.0.1 =
    218224
Note: See TracChangeset for help on using the changeset viewer.