Plugin Directory

Changeset 3394838


Ignore:
Timestamp:
11/13/2025 08:32:07 AM (4 weeks ago)
Author:
Icegram
Message:

Preparing for 5.9.11 release

Location:
email-subscribers/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • email-subscribers/trunk/email-subscribers.php

    r3393565 r3394838  
    44 * Plugin URI: https://www.icegram.com/
    55 * Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
    6  * Version: 5.9.10
     6 * Version: 5.9.11
    77 * Author: Icegram
    88 * Author URI: https://www.icegram.com/
     
    188188
    189189if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
    190     define( 'ES_PLUGIN_VERSION', '5.9.10' );
     190    define( 'ES_PLUGIN_VERSION', '5.9.11' );
    191191}
    192192
  • email-subscribers/trunk/lite/includes/classes/class-es-queue.php

    r3246944 r3394838  
    11321132        public function trigger_mailing_queue_sending() {
    11331133
     1134            $can_access_campaign = ES_Common::ig_es_can_access( 'campaigns' );
     1135            $nonce = ig_es_get_request_data( 'nonce' );
     1136           
     1137            if ( ! $can_access_campaign ) {
     1138                return;
     1139            }
     1140
     1141            if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'ig-es-trigger-mailing-queue-sending-nonce' ) ) {
     1142                return;
     1143            }
     1144               
    11341145            // Call cron action only when it is not locked.
    1135             if ( ! ES()->cron->is_locked() ) {
    1136 
     1146            if ( ! ES()->cron->is_locked() ) {     
    11371147                // Start processing of campaigns which are scheduled for current date time.
    11381148                do_action( 'ig_es_cron_worker' );
  • email-subscribers/trunk/lite/includes/classes/class-ig-es-background-process-helper.php

    r2602749 r3394838  
    172172                $action_id = as_schedule_single_action( $time, $action, array( $action_args ), 'email-subscribers' );
    173173
    174                 if ( ! empty( $action_id ) ) {
     174                if ( ! empty( $action_id ) ) { 
    175175                    if ( $process_asynchronously ) {
    176176                        $request_args = array(
    177177                            'action'    => 'ig_es_run_action_scheduler_task',
    178178                            'action_id' => $action_id,
     179                            'guid' => ES()->cron->get_cron_guid(),
    179180                        );
    180181                        self::send_async_ajax_request( $request_args, $should_wait );
    181182                    }
    182                     return $action_id;
     183                    return $action_id; 
    183184                }
    184185            }
     
    195196
    196197            $action_id = ig_es_get_request_data( 'action_id' );
    197 
    198             if ( ! empty( $action_id ) ) {
    199                 if ( class_exists( 'ActionScheduler_QueueRunner' ) ) {
    200                     $queue_runner = ActionScheduler_QueueRunner::instance();
    201                     $queue_runner->process_action( $action_id, 'email-subscribers' );
    202                 }
    203             }
     198            $guid      = ig_es_get_request_data( 'guid' );
     199
     200            if ( empty( $action_id ) ) {
     201                return;
     202            }
     203
     204            if ( empty( $guid ) || ! ES()->cron->is_valid_request( $guid ) ) {
     205                return;
     206            }
     207
     208            if ( class_exists( 'ActionScheduler_QueueRunner' ) ) {
     209                $queue_runner = ActionScheduler_QueueRunner::instance();
     210                $queue_runner->process_action( $action_id, 'email-subscribers' );
     211            }
     212                   
     213                 
     214               
     215           
    204216        }
    205217
  • email-subscribers/trunk/lite/includes/controllers/class-es-campaign-controller.php

    r3393565 r3394838  
    104104                                'action'        => 'ig_es_trigger_mailing_queue_sending',
    105105                                'campaign_hash' => $mailing_queue_hash,
     106                                'nonce'         => wp_create_nonce( 'ig-es-trigger-mailing-queue-sending-nonce' ),
    106107                                );
    107108                                // Send an asynchronous request to trigger sending of campaign emails.
     
    562563                        'action'        => 'ig_es_trigger_mailing_queue_sending',
    563564                        'campaign_hash' => $mailing_queue_hash,
     565                        'nonce'         => wp_create_nonce( 'ig-es-trigger-mailing-queue-sending-nonce' ),
    564566                    );
    565567                    // Send an asynchronous request to trigger sending of campaign emails.
  • email-subscribers/trunk/lite/includes/controllers/class-es-form-controller.php

    r3379210 r3394838  
    720720            if ( isset( $form_data['settings'] ) && is_string( $form_data['settings'] ) ) {
    721721                // Try to unserialize settings if it's a string
    722                 $unserialized_settings = @unserialize( $form_data['settings'] );
     722                $unserialized_settings = ig_es_maybe_unserialize( $form_data['settings'] );
    723723                if ( $unserialized_settings !== false ) {
    724724                    $form_data['settings'] = $unserialized_settings;
  • email-subscribers/trunk/lite/includes/db/class-es-db.php

    r3393565 r3394838  
    664664        }
    665665
    666     // Get the first value from an array to check data structure
    667     $first_value = array_slice( $values, 0, 1 );
    668 
    669     $data = array_shift( $first_value );
    670 
    671     // Set default values
    672     $data = wp_parse_args( $data, $this->get_column_defaults() );
    673 
    674666    // Initialise column format array
    675667    $column_formats = $this->get_columns();
     
    678670    unset( $column_formats[ $this->primary_key ] );
    679671
    680     // Force fields to lower case
    681     $data = array_change_key_case( $data );
    682 
    683     // White list columns
    684     $data = array_intersect_key( $data, $column_formats );
    685 
    686     // Reorder $column_formats to match the order of columns given in $data
    687     $data = wp_parse_args( $data, $this->get_column_defaults() );
    688 
    689     // Collect ALL possible fields from ALL records in the batch to ensure consistent field list
     672    // Get proper default values for columns
     673    $column_defaults = $this->get_column_defaults();
     674
     675    // Normalize all records and collect all possible fields
    690676    $all_fields = array();
     677    $normalized_values = array();
     678   
    691679    foreach ( $values as $single_value ) {
     680        // Force fields to lower case
    692681        $single_value = array_change_key_case( $single_value );
     682        // White list columns - only keep valid database columns
    693683        $single_value = array_intersect_key( $single_value, $column_formats );
     684        $normalized_values[] = $single_value;
    694685        $all_fields = array_merge( $all_fields, array_keys( $single_value ) );
    695686    }
    696687    $all_fields = array_unique( $all_fields );
    697688   
    698     // Update column_formats to include only the fields present across all records
     689    // If no fields found, nothing to insert
     690    if ( empty( $all_fields ) ) {
     691        return false;
     692    }
     693   
     694    // Update column_formats to include only the fields present in the data
    699695    $column_formats = array_intersect_key( $column_formats, array_flip( $all_fields ) );
    700696   
    701     // Update data defaults to include all fields
    702     $data = array_merge( array_fill_keys( $all_fields, null ), $data );
    703     $data = array_intersect_key( $data, $column_formats );
    704 
    705     $data_keys = array_keys( $data );
    706 
    707     $fields = array_keys( array_merge( array_flip( $data_keys ), $column_formats ) );       // Convert Batches into smaller chunk
    708         $batches = array_chunk( $values, $length );
     697    // Create default values for all fields using proper column defaults
     698    $default_values = array();
     699    foreach ( $all_fields as $field ) {
     700        $default_values[ $field ] = isset( $column_defaults[ $field ] ) ? $column_defaults[ $field ] : null;
     701    }
     702
     703    // Get field names for SQL query
     704    $fields = array_keys( $column_formats );        // Convert Batches into smaller chunk
     705        $batches = array_chunk( $normalized_values, $length );
    709706
    710707        $error_flag = false;
     
    722719
    723720                $formats = array();
     721                // Merge default NULL values with actual record values
     722                $value_with_defaults = array_merge( $default_values, $value );
     723               
    724724                foreach ( $column_formats as $column => $format ) {
    725                     $final_values[] = isset( $value[ $column ] ) ? $value[ $column ] : $data[ $column ]; // set default if we don't have
     725                    $final_values[] = isset( $value_with_defaults[ $column ] ) ? $value_with_defaults[ $column ] : null;
    726726                    $formats[]      = $format;
    727727                }
  • email-subscribers/trunk/readme.txt

    r3393565 r3394838  
    77Tested up to: 6.8
    88Requires PHP: 7.0
    9 Stable tag: 5.9.10
     9Stable tag: 5.9.11
    1010License: GPLv3
    1111
     
    342342== Upgrade Notice ==
    343343
    344 = 5.9.10 =
    345 
    346 * New: Revamped campaign edit interface for a smoother user experience 
    347 * Improvement: Enhanced audience dashboard UI for better usability 
    348 * Fix: Fixed broken links on the main dashboard page
     344= 5.9.11 =
     345
     346* Improvements: Enhanced security for campaign sending and background task processing
     347* Fix: Resolved a fatal error occurring during CSV import
    349348
    350349== Changelog ==
     350
     351**5.9.11 (13.11.2025)**
     352
     353* Fix: Fixed missing auth and nonce check vulnerability in background task processing library [Thanks to WordFence team]
     354* Fix: Fixed PHP Object injection vulnerability in forms [Thanks to Patchstack team]
    351355
    352356**5.9.10 (11.11.2025)**
Note: See TracChangeset for help on using the changeset viewer.