Plugin Directory

Changeset 3287138


Ignore:
Timestamp:
05/04/2025 10:37:51 AM (11 months ago)
Author:
themesgrove
Message:

Update to version 2.7.13 from GitHub

Location:
smartpay
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smartpay/tags/2.7.13/app/Http/Controllers/Rest/CustomerController.php

    r2789849 r3287138  
    5959        $requestData = \json_decode($request->get_body(), true);
    6060
    61         if (empty($requestData['first_name']) || empty($requestData['last_name']) || empty($requestData['email'])) {
     61        // Sanitize input data.
     62        $firstName = sanitize_text_field( $request->get_param( 'first_name' ) ?? '' );
     63        $lastName  = sanitize_text_field( $request->get_param( 'last_name' ) ?? '' );
     64        $email     = sanitize_email( sanitize_text_field( $request->get_param( 'email' ) ?? '' ) );
     65
     66        if (empty($firstName) || empty($lastName) || empty($email)) {
    6267            return new WP_REST_Response(['message' => __('You must input first name, last name and email', 'smartpay')], 404);
    6368        }
     
    7075        $wpdb->query('START TRANSACTION');
    7176
    72         $customer->first_name = $requestData['first_name'];
    73         $customer->last_name = $requestData['last_name'];
    74         $customer->email = $requestData['email'];
     77        $customer->first_name = $firstName;
     78        $customer->last_name = $lastName;
     79        $customer->email = $email;
    7580        $customer->save();
    7681
     
    7883        $userdata = wp_update_user([
    7984            'ID' => $request->get_param('id'),
    80             'display_name' => $requestData['first_name']  . ' ' . $requestData['last_name'],
    81             'user_email' => $requestData['email'],
     85            'display_name' => $firstName  . ' ' . $lastName,
     86            'user_email' => $email,
    8287        ]);
    8388
  • smartpay/tags/2.7.13/app/Modules/Payment/Payment.php

    r2791699 r3287138  
    240240    private function _get_payment_customer($_data)
    241241    {
    242         $customer = Customer::where('email', $_data['smartpay_email'])->first();
     242        // Sanitize Data.
     243        $first_name = sanitize_text_field( $_data['smartpay_first_name'] ?? '' );
     244        $last_name  = sanitize_text_field( $_data['smartpay_last_name'] ?? '' );
     245        $email      = sanitize_email( sanitize_text_field( $_data['smartpay_email'] ?? '' ) );
     246
     247        $customer = Customer::where('email', $email)->first();
    243248
    244249        if ($customer && $customer->id) {
     
    247252            $customer = new Customer();
    248253            $customer->user_id      = is_user_logged_in() ? get_current_user_id() : 0;
    249             $customer->first_name   = $_data['smartpay_first_name'];
    250             $customer->last_name    = $_data['smartpay_last_name'];
    251             $customer->email        = $_data['smartpay_email'];
     254            $customer->first_name   = $first_name;
     255            $customer->last_name    = $last_name;
     256            $customer->email        = $email;
    252257
    253258            $customer->save();
     
    257262        return [
    258263            'customer_id' => $customer_id ?? 0,
    259             'first_name'  => $_data['smartpay_first_name'] ?? '',
    260             'last_name'   => $_data['smartpay_last_name'] ?? '',
    261             'email'       => $_data['smartpay_email'] ?? '',
     264            'first_name'  => $first_name,
     265            'last_name'   => $last_name,
     266            'email'       => $email,
    262267        ];
    263268    }
  • smartpay/tags/2.7.13/bootstrap.php

    r2703855 r3287138  
    2525    require_once(ABSPATH . '/wp-admin/includes/plugin.php');
    2626    if (defined('SMARTPAY_PRO_VERSION')) {
    27         if (floatval(SMARTPAY_PRO_VERSION) < 2.6){
     27        if (floatval(SMARTPAY_PRO_VERSION) < 2.6 && "##SMARTPAY_PRO_VERSION##" !== SMARTPAY_PRO_VERSION){
    2828            add_action('admin_notices', 'smartpay_pro_deactivate_notice');
    2929            deactivate_plugins(SMARTPAY_PRO_PLUGIN_FILE);
  • smartpay/tags/2.7.13/readme.txt

    r3205505 r3287138  
    55Tested up to: 6.7
    66Requires PHP: 8.1
    7 Stable Tag: 2.7.12
     7Stable Tag: 2.7.13
    88License: GNU Version 2 or later
    99
     
    113113
    114114== Changelog ==
     115= [2.7.13] =
     116* Fix - Input sanitization for form submission.
     117* Fix - Text domain warning.
     118
    115119= [2.7.12] =
    116120* Fix - Add instructions to enable payment gateways in pro version.
  • smartpay/tags/2.7.13/smartpay.php

    r3205505 r3287138  
    66 * Tags: download manager, digital product, donation, ecommerce, paddle, stripe, paypal, document manager, file manager, download protection, recurring payment, donations, donation plugin, wordpress donation plugin, wp donation, fundraising, fundraiser, crowdfunding, wordpress donations, gutenberg, gutenberg donations, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations, bkash, bkash payment,
    77 *
    8  * Version: 2.7.12
     8 * Version: 2.7.13
    99 * Requires PHP: 8.1
    1010 * Requires at least: 6.0
     
    4848
    4949    // Run The Application
    50     $app->boot();
     50    // $app->boot();
    5151});
    5252
    53 add_action('init', function () {
     53add_action('init', function () use ($app) {
    5454    do_action('smartpay_init');
     55
     56    // Run The Application
     57    $app->boot();
    5558
    5659    // Load translations
  • smartpay/tags/2.7.13/vendor/composer/InstalledVersions.php

    r2933625 r3287138  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    323334
    324335        $installed = array();
     336        $copiedLocalDir = false;
    325337
    326338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    327340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    328342                if (isset(self::$installedByVendor[$vendorDir])) {
    329343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331345                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332346                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     347                    self::$installedByVendor[$vendorDir] = $required;
     348                    $installed[] = $required;
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     350                        self::$installed = $required;
     351                        self::$installedIsLocalDir = true;
    336352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    337356                }
    338357            }
     
    351370        }
    352371
    353         if (self::$installed !== array()) {
     372        if (self::$installed !== array() && !$copiedLocalDir) {
    354373            $installed[] = self::$installed;
    355374        }
  • smartpay/tags/2.7.13/vendor/composer/installed.php

    r3205505 r3287138  
    22    'root' => array(
    33        'name' => 'wp-smartpay/core',
    4         'pretty_version' => 'v2.7.12',
    5         'version' => '2.7.12.0',
    6         'reference' => '10c1764fc1fdca88317ac32a3cd5b02ef12e4931',
     4        'pretty_version' => 'v2.7.13',
     5        'version' => '2.7.13.0',
     6        'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    108108        ),
    109109        'wp-smartpay/core' => array(
    110             'pretty_version' => 'v2.7.12',
    111             'version' => '2.7.12.0',
    112             'reference' => '10c1764fc1fdca88317ac32a3cd5b02ef12e4931',
     110            'pretty_version' => 'v2.7.13',
     111            'version' => '2.7.13.0',
     112            'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a',
    113113            'type' => 'library',
    114114            'install_path' => __DIR__ . '/../../',
  • smartpay/trunk/app/Http/Controllers/Rest/CustomerController.php

    r2789849 r3287138  
    5959        $requestData = \json_decode($request->get_body(), true);
    6060
    61         if (empty($requestData['first_name']) || empty($requestData['last_name']) || empty($requestData['email'])) {
     61        // Sanitize input data.
     62        $firstName = sanitize_text_field( $request->get_param( 'first_name' ) ?? '' );
     63        $lastName  = sanitize_text_field( $request->get_param( 'last_name' ) ?? '' );
     64        $email     = sanitize_email( sanitize_text_field( $request->get_param( 'email' ) ?? '' ) );
     65
     66        if (empty($firstName) || empty($lastName) || empty($email)) {
    6267            return new WP_REST_Response(['message' => __('You must input first name, last name and email', 'smartpay')], 404);
    6368        }
     
    7075        $wpdb->query('START TRANSACTION');
    7176
    72         $customer->first_name = $requestData['first_name'];
    73         $customer->last_name = $requestData['last_name'];
    74         $customer->email = $requestData['email'];
     77        $customer->first_name = $firstName;
     78        $customer->last_name = $lastName;
     79        $customer->email = $email;
    7580        $customer->save();
    7681
     
    7883        $userdata = wp_update_user([
    7984            'ID' => $request->get_param('id'),
    80             'display_name' => $requestData['first_name']  . ' ' . $requestData['last_name'],
    81             'user_email' => $requestData['email'],
     85            'display_name' => $firstName  . ' ' . $lastName,
     86            'user_email' => $email,
    8287        ]);
    8388
  • smartpay/trunk/app/Modules/Payment/Payment.php

    r2791699 r3287138  
    240240    private function _get_payment_customer($_data)
    241241    {
    242         $customer = Customer::where('email', $_data['smartpay_email'])->first();
     242        // Sanitize Data.
     243        $first_name = sanitize_text_field( $_data['smartpay_first_name'] ?? '' );
     244        $last_name  = sanitize_text_field( $_data['smartpay_last_name'] ?? '' );
     245        $email      = sanitize_email( sanitize_text_field( $_data['smartpay_email'] ?? '' ) );
     246
     247        $customer = Customer::where('email', $email)->first();
    243248
    244249        if ($customer && $customer->id) {
     
    247252            $customer = new Customer();
    248253            $customer->user_id      = is_user_logged_in() ? get_current_user_id() : 0;
    249             $customer->first_name   = $_data['smartpay_first_name'];
    250             $customer->last_name    = $_data['smartpay_last_name'];
    251             $customer->email        = $_data['smartpay_email'];
     254            $customer->first_name   = $first_name;
     255            $customer->last_name    = $last_name;
     256            $customer->email        = $email;
    252257
    253258            $customer->save();
     
    257262        return [
    258263            'customer_id' => $customer_id ?? 0,
    259             'first_name'  => $_data['smartpay_first_name'] ?? '',
    260             'last_name'   => $_data['smartpay_last_name'] ?? '',
    261             'email'       => $_data['smartpay_email'] ?? '',
     264            'first_name'  => $first_name,
     265            'last_name'   => $last_name,
     266            'email'       => $email,
    262267        ];
    263268    }
  • smartpay/trunk/bootstrap.php

    r2703855 r3287138  
    2525    require_once(ABSPATH . '/wp-admin/includes/plugin.php');
    2626    if (defined('SMARTPAY_PRO_VERSION')) {
    27         if (floatval(SMARTPAY_PRO_VERSION) < 2.6){
     27        if (floatval(SMARTPAY_PRO_VERSION) < 2.6 && "##SMARTPAY_PRO_VERSION##" !== SMARTPAY_PRO_VERSION){
    2828            add_action('admin_notices', 'smartpay_pro_deactivate_notice');
    2929            deactivate_plugins(SMARTPAY_PRO_PLUGIN_FILE);
  • smartpay/trunk/readme.txt

    r3205505 r3287138  
    55Tested up to: 6.7
    66Requires PHP: 8.1
    7 Stable Tag: 2.7.12
     7Stable Tag: 2.7.13
    88License: GNU Version 2 or later
    99
     
    113113
    114114== Changelog ==
     115= [2.7.13] =
     116* Fix - Input sanitization for form submission.
     117* Fix - Text domain warning.
     118
    115119= [2.7.12] =
    116120* Fix - Add instructions to enable payment gateways in pro version.
  • smartpay/trunk/smartpay.php

    r3205505 r3287138  
    66 * Tags: download manager, digital product, donation, ecommerce, paddle, stripe, paypal, document manager, file manager, download protection, recurring payment, donations, donation plugin, wordpress donation plugin, wp donation, fundraising, fundraiser, crowdfunding, wordpress donations, gutenberg, gutenberg donations, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations, bkash, bkash payment,
    77 *
    8  * Version: 2.7.12
     8 * Version: 2.7.13
    99 * Requires PHP: 8.1
    1010 * Requires at least: 6.0
     
    4848
    4949    // Run The Application
    50     $app->boot();
     50    // $app->boot();
    5151});
    5252
    53 add_action('init', function () {
     53add_action('init', function () use ($app) {
    5454    do_action('smartpay_init');
     55
     56    // Run The Application
     57    $app->boot();
    5558
    5659    // Load translations
  • smartpay/trunk/vendor/composer/InstalledVersions.php

    r2933625 r3287138  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    323334
    324335        $installed = array();
     336        $copiedLocalDir = false;
    325337
    326338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    327340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    328342                if (isset(self::$installedByVendor[$vendorDir])) {
    329343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331345                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332346                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     347                    self::$installedByVendor[$vendorDir] = $required;
     348                    $installed[] = $required;
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     350                        self::$installed = $required;
     351                        self::$installedIsLocalDir = true;
    336352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    337356                }
    338357            }
     
    351370        }
    352371
    353         if (self::$installed !== array()) {
     372        if (self::$installed !== array() && !$copiedLocalDir) {
    354373            $installed[] = self::$installed;
    355374        }
  • smartpay/trunk/vendor/composer/installed.php

    r3205505 r3287138  
    22    'root' => array(
    33        'name' => 'wp-smartpay/core',
    4         'pretty_version' => 'v2.7.12',
    5         'version' => '2.7.12.0',
    6         'reference' => '10c1764fc1fdca88317ac32a3cd5b02ef12e4931',
     4        'pretty_version' => 'v2.7.13',
     5        'version' => '2.7.13.0',
     6        'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    108108        ),
    109109        'wp-smartpay/core' => array(
    110             'pretty_version' => 'v2.7.12',
    111             'version' => '2.7.12.0',
    112             'reference' => '10c1764fc1fdca88317ac32a3cd5b02ef12e4931',
     110            'pretty_version' => 'v2.7.13',
     111            'version' => '2.7.13.0',
     112            'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a',
    113113            'type' => 'library',
    114114            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.