Changeset 3287138
- Timestamp:
- 05/04/2025 10:37:51 AM (11 months ago)
- Location:
- smartpay
- Files:
-
- 14 edited
- 1 copied
-
tags/2.7.13 (copied) (copied from smartpay/trunk)
-
tags/2.7.13/app/Http/Controllers/Rest/CustomerController.php (modified) (3 diffs)
-
tags/2.7.13/app/Modules/Payment/Payment.php (modified) (3 diffs)
-
tags/2.7.13/bootstrap.php (modified) (1 diff)
-
tags/2.7.13/readme.txt (modified) (2 diffs)
-
tags/2.7.13/smartpay.php (modified) (2 diffs)
-
tags/2.7.13/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
tags/2.7.13/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/app/Http/Controllers/Rest/CustomerController.php (modified) (3 diffs)
-
trunk/app/Modules/Payment/Payment.php (modified) (3 diffs)
-
trunk/bootstrap.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/smartpay.php (modified) (2 diffs)
-
trunk/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smartpay/tags/2.7.13/app/Http/Controllers/Rest/CustomerController.php
r2789849 r3287138 59 59 $requestData = \json_decode($request->get_body(), true); 60 60 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)) { 62 67 return new WP_REST_Response(['message' => __('You must input first name, last name and email', 'smartpay')], 404); 63 68 } … … 70 75 $wpdb->query('START TRANSACTION'); 71 76 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; 75 80 $customer->save(); 76 81 … … 78 83 $userdata = wp_update_user([ 79 84 '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, 82 87 ]); 83 88 -
smartpay/tags/2.7.13/app/Modules/Payment/Payment.php
r2791699 r3287138 240 240 private function _get_payment_customer($_data) 241 241 { 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(); 243 248 244 249 if ($customer && $customer->id) { … … 247 252 $customer = new Customer(); 248 253 $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; 252 257 253 258 $customer->save(); … … 257 262 return [ 258 263 '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, 262 267 ]; 263 268 } -
smartpay/tags/2.7.13/bootstrap.php
r2703855 r3287138 25 25 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 26 26 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){ 28 28 add_action('admin_notices', 'smartpay_pro_deactivate_notice'); 29 29 deactivate_plugins(SMARTPAY_PRO_PLUGIN_FILE); -
smartpay/tags/2.7.13/readme.txt
r3205505 r3287138 5 5 Tested up to: 6.7 6 6 Requires PHP: 8.1 7 Stable Tag: 2.7.1 27 Stable Tag: 2.7.13 8 8 License: GNU Version 2 or later 9 9 … … 113 113 114 114 == Changelog == 115 = [2.7.13] = 116 * Fix - Input sanitization for form submission. 117 * Fix - Text domain warning. 118 115 119 = [2.7.12] = 116 120 * Fix - Add instructions to enable payment gateways in pro version. -
smartpay/tags/2.7.13/smartpay.php
r3205505 r3287138 6 6 * 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, 7 7 * 8 * Version: 2.7.1 28 * Version: 2.7.13 9 9 * Requires PHP: 8.1 10 10 * Requires at least: 6.0 … … 48 48 49 49 // Run The Application 50 $app->boot();50 // $app->boot(); 51 51 }); 52 52 53 add_action('init', function () {53 add_action('init', function () use ($app) { 54 54 do_action('smartpay_init'); 55 56 // Run The Application 57 $app->boot(); 55 58 56 59 // Load translations -
smartpay/tags/2.7.13/vendor/composer/InstalledVersions.php
r2933625 r3287138 32 32 */ 33 33 private static $installed; 34 35 /** 36 * @var bool 37 */ 38 private static $installedIsLocalDir; 34 39 35 40 /** … … 310 315 self::$installed = $data; 311 316 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; 312 323 } 313 324 … … 323 334 324 335 $installed = array(); 336 $copiedLocalDir = false; 325 337 326 338 if (self::$canGetVendors) { 339 $selfDir = strtr(__DIR__, '\\', '/'); 327 340 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 $vendorDir = strtr($vendorDir, '\\', '/'); 328 342 if (isset(self::$installedByVendor[$vendorDir])) { 329 343 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 345 /** @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 */ 332 346 $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; 336 352 } 353 } 354 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 355 $copiedLocalDir = true; 337 356 } 338 357 } … … 351 370 } 352 371 353 if (self::$installed !== array() ) {372 if (self::$installed !== array() && !$copiedLocalDir) { 354 373 $installed[] = self::$installed; 355 374 } -
smartpay/tags/2.7.13/vendor/composer/installed.php
r3205505 r3287138 2 2 'root' => array( 3 3 'name' => 'wp-smartpay/core', 4 'pretty_version' => 'v2.7.1 2',5 'version' => '2.7.1 2.0',6 'reference' => ' 10c1764fc1fdca88317ac32a3cd5b02ef12e4931',4 'pretty_version' => 'v2.7.13', 5 'version' => '2.7.13.0', 6 'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 108 108 ), 109 109 'wp-smartpay/core' => array( 110 'pretty_version' => 'v2.7.1 2',111 'version' => '2.7.1 2.0',112 'reference' => ' 10c1764fc1fdca88317ac32a3cd5b02ef12e4931',110 'pretty_version' => 'v2.7.13', 111 'version' => '2.7.13.0', 112 'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a', 113 113 'type' => 'library', 114 114 'install_path' => __DIR__ . '/../../', -
smartpay/trunk/app/Http/Controllers/Rest/CustomerController.php
r2789849 r3287138 59 59 $requestData = \json_decode($request->get_body(), true); 60 60 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)) { 62 67 return new WP_REST_Response(['message' => __('You must input first name, last name and email', 'smartpay')], 404); 63 68 } … … 70 75 $wpdb->query('START TRANSACTION'); 71 76 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; 75 80 $customer->save(); 76 81 … … 78 83 $userdata = wp_update_user([ 79 84 '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, 82 87 ]); 83 88 -
smartpay/trunk/app/Modules/Payment/Payment.php
r2791699 r3287138 240 240 private function _get_payment_customer($_data) 241 241 { 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(); 243 248 244 249 if ($customer && $customer->id) { … … 247 252 $customer = new Customer(); 248 253 $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; 252 257 253 258 $customer->save(); … … 257 262 return [ 258 263 '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, 262 267 ]; 263 268 } -
smartpay/trunk/bootstrap.php
r2703855 r3287138 25 25 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 26 26 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){ 28 28 add_action('admin_notices', 'smartpay_pro_deactivate_notice'); 29 29 deactivate_plugins(SMARTPAY_PRO_PLUGIN_FILE); -
smartpay/trunk/readme.txt
r3205505 r3287138 5 5 Tested up to: 6.7 6 6 Requires PHP: 8.1 7 Stable Tag: 2.7.1 27 Stable Tag: 2.7.13 8 8 License: GNU Version 2 or later 9 9 … … 113 113 114 114 == Changelog == 115 = [2.7.13] = 116 * Fix - Input sanitization for form submission. 117 * Fix - Text domain warning. 118 115 119 = [2.7.12] = 116 120 * Fix - Add instructions to enable payment gateways in pro version. -
smartpay/trunk/smartpay.php
r3205505 r3287138 6 6 * 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, 7 7 * 8 * Version: 2.7.1 28 * Version: 2.7.13 9 9 * Requires PHP: 8.1 10 10 * Requires at least: 6.0 … … 48 48 49 49 // Run The Application 50 $app->boot();50 // $app->boot(); 51 51 }); 52 52 53 add_action('init', function () {53 add_action('init', function () use ($app) { 54 54 do_action('smartpay_init'); 55 56 // Run The Application 57 $app->boot(); 55 58 56 59 // Load translations -
smartpay/trunk/vendor/composer/InstalledVersions.php
r2933625 r3287138 32 32 */ 33 33 private static $installed; 34 35 /** 36 * @var bool 37 */ 38 private static $installedIsLocalDir; 34 39 35 40 /** … … 310 315 self::$installed = $data; 311 316 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; 312 323 } 313 324 … … 323 334 324 335 $installed = array(); 336 $copiedLocalDir = false; 325 337 326 338 if (self::$canGetVendors) { 339 $selfDir = strtr(__DIR__, '\\', '/'); 327 340 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 341 $vendorDir = strtr($vendorDir, '\\', '/'); 328 342 if (isset(self::$installedByVendor[$vendorDir])) { 329 343 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 345 /** @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 */ 332 346 $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; 336 352 } 353 } 354 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 355 $copiedLocalDir = true; 337 356 } 338 357 } … … 351 370 } 352 371 353 if (self::$installed !== array() ) {372 if (self::$installed !== array() && !$copiedLocalDir) { 354 373 $installed[] = self::$installed; 355 374 } -
smartpay/trunk/vendor/composer/installed.php
r3205505 r3287138 2 2 'root' => array( 3 3 'name' => 'wp-smartpay/core', 4 'pretty_version' => 'v2.7.1 2',5 'version' => '2.7.1 2.0',6 'reference' => ' 10c1764fc1fdca88317ac32a3cd5b02ef12e4931',4 'pretty_version' => 'v2.7.13', 5 'version' => '2.7.13.0', 6 'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 108 108 ), 109 109 'wp-smartpay/core' => array( 110 'pretty_version' => 'v2.7.1 2',111 'version' => '2.7.1 2.0',112 'reference' => ' 10c1764fc1fdca88317ac32a3cd5b02ef12e4931',110 'pretty_version' => 'v2.7.13', 111 'version' => '2.7.13.0', 112 'reference' => '5a9f8ccabb382402e8285c044ae077943e10356a', 113 113 'type' => 'library', 114 114 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.