Plugin Directory

Changeset 3007057


Ignore:
Timestamp:
12/07/2023 11:34:06 PM (17 months ago)
Author:
carazo
Message:

In the cron settings, when it comes to URLs or paths, if it comes to paths and any with a different ending than .csv is included, we return a blank string to avoid problems

Location:
import-users-from-csv-with-meta
Files:
4 edited
4 copied

Legend:

Unmodified
Added
Removed
  • import-users-from-csv-with-meta/tags/1.24.3/classes/cron.php

    r3000382 r3007057  
    99        add_action( 'acui_cron_process_step', array( $this, 'process_step' ), 10, 2 );
    1010        add_action( 'wp_ajax_acui_fire_cron', array( $this, 'ajax_fire_cron' ) );
     11    }
     12
     13    function clean_path_url_csv( $path_url ){
     14        if( filter_var( $path_url, FILTER_VALIDATE_URL) !== false )
     15            return $path_url;
     16
     17        if( strtolower( pathinfo( $path_url, PATHINFO_EXTENSION ) ) !== 'csv' )
     18            return '';
     19
     20        return $path_url;
    1121    }
    1222
     
    3949        update_option( "acui_cron_path_to_move_auto_rename", isset( $form_data["path_to_move_auto_rename"] ) && $form_data["path_to_move_auto_rename"] == "1" );
    4050        update_option( "acui_cron_allow_multiple_accounts", ( isset( $form_data["allow_multiple_accounts"] ) && $form_data["allow_multiple_accounts"] == "1" ) ? "allowed" : "not_allowed" );
    41         update_option( "acui_cron_path_to_file", sanitize_text_field( $form_data["path_to_file"] ) );
    42         update_option( "acui_cron_path_to_move", sanitize_text_field( $form_data["path_to_move"] ) );
     51        update_option( "acui_cron_path_to_file", $this->clean_path_url_csv( sanitize_text_field( $form_data["path_to_file"] ) ) );
     52        update_option( "acui_cron_path_to_move", $this->clean_path_url_csv( sanitize_text_field( $form_data["path_to_move"] ) ) );
    4353        update_option( "acui_cron_period", sanitize_text_field( $form_data["period"] ) );
    4454        update_option( "acui_cron_role", sanitize_text_field( $form_data["role"] ) );
     
    5969
    6070        $form_data = array();
    61         $form_data[ "path_to_file" ] = get_option( "acui_cron_path_to_file");
     71        $form_data[ "path_to_file" ] = $this->clean_path_url_csv( get_option( "acui_cron_path_to_file") );
    6272        $form_data[ "role" ] = get_option( "acui_cron_role");
    6373        $form_data[ "update_roles_existing_users" ] = ( get_option( "acui_cron_update_roles_existing_users" ) ) ? 'yes' : 'no';
     
    7585       
    7686        if( $move_file_cron ){
    77             $path_to_file = get_option( "acui_cron_path_to_file");
    78             $path_to_move = get_option( "acui_cron_path_to_move");
    79 
    80             rename( $path_to_file, $path_to_move );
    81 
     87            $path_to_move = $this->clean_path_url_csv( get_option( "acui_cron_path_to_move") );
     88            rename( $form_data[ "path_to_file" ], $path_to_move );
    8289            $this->auto_rename();
    8390        }
     
    9198
    9299        $form_data = array();
    93         $form_data[ "path_to_file" ] = get_option( "acui_cron_path_to_file");
     100        $form_data[ "path_to_file" ] = $this->clean_path_url_csv( get_option( "acui_cron_path_to_file") );
    94101        $form_data[ "role" ] = get_option( "acui_cron_role");
    95102        $form_data[ "update_roles_existing_users" ] = ( get_option( "acui_cron_update_roles_existing_users" ) ) ? 'yes' : 'no';
     
    127134    }
    128135
    129     public static function admin_gui(){
     136    static function admin_gui(){
    130137        $upload_dir = wp_upload_dir();
    131138        $sample_path = $upload_dir["path"] . '/test.csv';
  • import-users-from-csv-with-meta/tags/1.24.3/import-users-from-csv-with-meta.php

    r3005960 r3007057  
    44Plugin URI:     https://www.codection.com
    55Description:    Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
    6 Version:        1.24.2
     6Version:        1.24.3
    77Author:         codection
    88Author URI:     https://codection.com
     
    1212Domain Path: /languages
    1313*/
     14
    1415if ( ! defined( 'ABSPATH' ) )
    1516    exit;
    1617
    17 define( 'ACUI_VERSION', '1.24.2' );
     18define( 'ACUI_VERSION', '1.24.3' );
    1819
    1920class ImportExportUsersCustomers{
  • import-users-from-csv-with-meta/tags/1.24.3/readme.txt

    r3005960 r3007057  
    44Tags: csv, import, export, importer, exporter, meta data, meta, user, users, user meta,  editor, profile, custom, fields, delimiter, update, insert, automatically, cron
    55Requires at least: 3.4
    6 Tested up to: 6.4.1
    7 Stable tag: 1.24.2
     6Tested up to: 6.4.2
     7Stable tag: 1.24.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.24.3 =
     112*   In the cron settings, when it comes to URLs or paths, if it comes to paths and any with a different ending than ".csv" is included, we return a blank string to avoid problems
     113
    111114= 1.24.2 =
    112115*   Fixed a problem when choosing to delete users not present in the CSV that caused more users to be deleted than it should
  • import-users-from-csv-with-meta/trunk/classes/cron.php

    r3000382 r3007057  
    99        add_action( 'acui_cron_process_step', array( $this, 'process_step' ), 10, 2 );
    1010        add_action( 'wp_ajax_acui_fire_cron', array( $this, 'ajax_fire_cron' ) );
     11    }
     12
     13    function clean_path_url_csv( $path_url ){
     14        if( filter_var( $path_url, FILTER_VALIDATE_URL) !== false )
     15            return $path_url;
     16
     17        if( strtolower( pathinfo( $path_url, PATHINFO_EXTENSION ) ) !== 'csv' )
     18            return '';
     19
     20        return $path_url;
    1121    }
    1222
     
    3949        update_option( "acui_cron_path_to_move_auto_rename", isset( $form_data["path_to_move_auto_rename"] ) && $form_data["path_to_move_auto_rename"] == "1" );
    4050        update_option( "acui_cron_allow_multiple_accounts", ( isset( $form_data["allow_multiple_accounts"] ) && $form_data["allow_multiple_accounts"] == "1" ) ? "allowed" : "not_allowed" );
    41         update_option( "acui_cron_path_to_file", sanitize_text_field( $form_data["path_to_file"] ) );
    42         update_option( "acui_cron_path_to_move", sanitize_text_field( $form_data["path_to_move"] ) );
     51        update_option( "acui_cron_path_to_file", $this->clean_path_url_csv( sanitize_text_field( $form_data["path_to_file"] ) ) );
     52        update_option( "acui_cron_path_to_move", $this->clean_path_url_csv( sanitize_text_field( $form_data["path_to_move"] ) ) );
    4353        update_option( "acui_cron_period", sanitize_text_field( $form_data["period"] ) );
    4454        update_option( "acui_cron_role", sanitize_text_field( $form_data["role"] ) );
     
    5969
    6070        $form_data = array();
    61         $form_data[ "path_to_file" ] = get_option( "acui_cron_path_to_file");
     71        $form_data[ "path_to_file" ] = $this->clean_path_url_csv( get_option( "acui_cron_path_to_file") );
    6272        $form_data[ "role" ] = get_option( "acui_cron_role");
    6373        $form_data[ "update_roles_existing_users" ] = ( get_option( "acui_cron_update_roles_existing_users" ) ) ? 'yes' : 'no';
     
    7585       
    7686        if( $move_file_cron ){
    77             $path_to_file = get_option( "acui_cron_path_to_file");
    78             $path_to_move = get_option( "acui_cron_path_to_move");
    79 
    80             rename( $path_to_file, $path_to_move );
    81 
     87            $path_to_move = $this->clean_path_url_csv( get_option( "acui_cron_path_to_move") );
     88            rename( $form_data[ "path_to_file" ], $path_to_move );
    8289            $this->auto_rename();
    8390        }
     
    9198
    9299        $form_data = array();
    93         $form_data[ "path_to_file" ] = get_option( "acui_cron_path_to_file");
     100        $form_data[ "path_to_file" ] = $this->clean_path_url_csv( get_option( "acui_cron_path_to_file") );
    94101        $form_data[ "role" ] = get_option( "acui_cron_role");
    95102        $form_data[ "update_roles_existing_users" ] = ( get_option( "acui_cron_update_roles_existing_users" ) ) ? 'yes' : 'no';
     
    127134    }
    128135
    129     public static function admin_gui(){
     136    static function admin_gui(){
    130137        $upload_dir = wp_upload_dir();
    131138        $sample_path = $upload_dir["path"] . '/test.csv';
  • import-users-from-csv-with-meta/trunk/import-users-from-csv-with-meta.php

    r3005960 r3007057  
    44Plugin URI:     https://www.codection.com
    55Description:    Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
    6 Version:        1.24.2
     6Version:        1.24.3
    77Author:         codection
    88Author URI:     https://codection.com
     
    1212Domain Path: /languages
    1313*/
     14
    1415if ( ! defined( 'ABSPATH' ) )
    1516    exit;
    1617
    17 define( 'ACUI_VERSION', '1.24.2' );
     18define( 'ACUI_VERSION', '1.24.3' );
    1819
    1920class ImportExportUsersCustomers{
  • import-users-from-csv-with-meta/trunk/readme.txt

    r3005960 r3007057  
    44Tags: csv, import, export, importer, exporter, meta data, meta, user, users, user meta,  editor, profile, custom, fields, delimiter, update, insert, automatically, cron
    55Requires at least: 3.4
    6 Tested up to: 6.4.1
    7 Stable tag: 1.24.2
     6Tested up to: 6.4.2
     7Stable tag: 1.24.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.24.3 =
     112*   In the cron settings, when it comes to URLs or paths, if it comes to paths and any with a different ending than ".csv" is included, we return a blank string to avoid problems
     113
    111114= 1.24.2 =
    112115*   Fixed a problem when choosing to delete users not present in the CSV that caused more users to be deleted than it should
Note: See TracChangeset for help on using the changeset viewer.