Changeset 2999526
- Timestamp:
- 11/21/2023 11:31:41 AM (2 years ago)
- Location:
- woosms-sms-module-for-woocommerce/trunk
- Files:
-
- 10 edited
-
readme.txt (modified) (2 diffs)
-
src/Event/Helpers.php (modified) (2 diffs)
-
src/Event/OrderForm.php (modified) (1 diff)
-
src/Template/Basic.php (modified) (3 diffs)
-
src/Template/Init.php (modified) (2 diffs)
-
vendor/bulkgate/plugin/src/Event/Dispatcher.php (modified) (2 diffs)
-
vendor/bulkgate/plugin/src/Event/Hook.php (modified) (1 diff)
-
vendor/composer/installed.json (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
-
woosms-sms-module-for-woocommerce.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woosms-sms-module-for-woocommerce/trunk/readme.txt
r2995942 r2999526 3 3 Requires at least: 5.7 4 4 Tested up to: 6.4 5 Stable tag: 3.0. 05 Stable tag: 3.0.3 6 6 Requires PHP: 7.4 7 7 License: GPLv3 … … 160 160 161 161 == Changelog == 162 163 = 3.0.3 = 164 * Broken Access Control vulnerability fix 165 * OptIn Checkbox set default to off 166 * Order message mutation fix values 162 167 163 168 = 3.0.2 = -
woosms-sms-module-for-woocommerce/trunk/src/Event/Helpers.php
r2995624 r2999526 9 9 10 10 use BulkGate\{Plugin\DI\MissingServiceException, Plugin\Event\Dispatcher, Plugin\Strict, WooSms\DI\Factory}; 11 use function apply_filters, has_filter, str_replace ;11 use function apply_filters, has_filter, str_replace, current_user_can, wp_die, wp_verify_nonce; 12 12 13 13 class Helpers 14 14 { 15 15 use Strict; 16 17 public const CrossSiteRequestForgerySecurityParameter = 'security'; 16 18 17 19 public static function dispatch(string $name, callable $callback): callable … … 49 51 return $statuses["wc-$status"] ?? $status; 50 52 } 53 54 55 public static function checkAccess(?string $nonce): bool 56 { 57 if (!current_user_can('manage_options') || wp_verify_nonce($nonce ?? '') === false) 58 { 59 wp_die('', 403); 60 } 61 62 return true; 63 } 51 64 } -
woosms-sms-module-for-woocommerce/trunk/src/Event/OrderForm.php
r2995624 r2999526 15 15 use Strict; 16 16 17 public const DefaultEnabled = true;17 public const DefaultEnabled = false; 18 18 19 19 private const Consent = [ -
woosms-sms-module-for-woocommerce/trunk/src/Template/Basic.php
r2995624 r2999526 9 9 10 10 use function time, date, admin_url, is_ssl, wp_print_inline_script_tag, wp_print_script_tag; 11 use BulkGate\{Plugin\Event\Dispatcher, Plugin\IO\Url, Plugin\Settings\Settings, Plugin\Settings\Synchronizer, Plugin\Strict, Plugin\DI\Container, Plugin\User\Sign, WooSms\ Utils\Escape, WooSms\Event\OrderForm, WooSms\Utils\Logo};11 use BulkGate\{Plugin\Event\Dispatcher, Plugin\IO\Url, Plugin\Settings\Settings, Plugin\Settings\Synchronizer, Plugin\Strict, Plugin\DI\Container, Plugin\User\Sign, WooSms\Event\Helpers, WooSms\Utils\Escape, WooSms\Event\OrderForm, WooSms\Utils\Logo}; 12 12 13 13 class Basic … … 22 22 23 23 $ajax_url = admin_url('/admin-ajax.php', is_ssl() ? 'https' : 'http'); 24 $csfr_token = wp_create_nonce(); 24 25 25 26 $proxy = [ 26 27 'PROXY_LOG_IN' => [ 27 28 'url' => $ajax_url, 28 'params' => ['action' => 'login' ]29 'params' => ['action' => 'login', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token] 29 30 ], 30 31 'PROXY_LOG_OUT' => [ 31 32 'url' => $ajax_url, 32 'params' => ['action' => 'logout_module' ]33 'params' => ['action' => 'logout_module', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token] 33 34 ], 34 35 'PROXY_SAVE_MODULE_SETTINGS' => [ 35 36 'url' => $ajax_url, 36 'params' => ['action' => 'save_module_settings' ]37 'params' => ['action' => 'save_module_settings', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token] 37 38 ] 38 39 ]; … … 78 79 'Content-Type': "application/x-www-form-urlencoded" 79 80 }, 80 body: "action=authenticate",81 body: {$escape_js('action=authenticate&' . Helpers::CrossSiteRequestForgerySecurityParameter . "=$csfr_token")}, 81 82 }); 82 83 let {token, redirect} = await response.json(); -
woosms-sms-module-for-woocommerce/trunk/src/Template/Init.php
r2995756 r2999526 8 8 */ 9 9 10 use BulkGate\{Plugin\Debug\Logger, Plugin\Debug\Requirements, Plugin\Eshop, Plugin\Settings\Settings, Plugin\Strict, Plugin\User\Sign, Plugin\Utils\JsonResponse, WooSms\Ajax\Authenticate, WooSms\Ajax\PluginSettingsChange, WooSms\Debug\Page, WooSms\DI\Factory, WooSms\Utils\Logo, WooSms\Utils\Meta}; 10 use BulkGate\Plugin\{Debug\Logger, Debug\Requirements, Eshop, Settings\Settings, Strict, User\Sign, Utils\JsonResponse}; 11 use BulkGate\WooSms\{Ajax\Authenticate, Ajax\PluginSettingsChange, Debug\Page, DI\Factory, Event\Helpers, Utils\Logo, Utils\Meta}; 11 12 use function method_exists, in_array; 12 13 … … 47 48 }); 48 49 49 add_action('wp_ajax_authenticate', fn () => Factory::get()->getByClass(Authenticate::class)->run(admin_url('admin.php?page=bulkgate#/sign/in'))); 50 add_action('wp_ajax_authenticate', function (): void 51 { 52 Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && Factory::get()->getByClass(Authenticate::class)->run(admin_url('admin.php?page=bulkgate#/sign/in')); 53 }); 50 54 51 add_action('wp_ajax_login', fn () => JsonResponse::send(Factory::get()->getByClass(Sign::class)->in( 52 sanitize_text_field((string) ($_POST['__bulkgate']['email'] ?? '')), 53 sanitize_text_field((string) ($_POST['__bulkgate']['password'] ?? '')), 54 admin_url('admin.php?page=bulkgate#/dashboard') 55 ))); 55 add_action('wp_ajax_login', function (): void 56 { 57 Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(Sign::class)->in( 58 sanitize_text_field((string)($_POST['__bulkgate']['email'] ?? '')), 59 sanitize_text_field((string)($_POST['__bulkgate']['password'] ?? '')), 60 admin_url('admin.php?page=bulkgate#/dashboard') 61 )); 62 }); 56 63 57 add_action('wp_ajax_logout_module', fn () => JsonResponse::send(Factory::get()->getByClass(Sign::class)->out(admin_url('admin.php?page=bulkgate#/sign/in')))); 58 add_action('wp_ajax_save_module_settings', fn () => JsonResponse::send(Factory::get()->getByClass(PluginSettingsChange::class)->run($_POST['__bulkgate'] ?? []))); 64 add_action('wp_ajax_logout_module', function (): void 65 { 66 Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(Sign::class)->out(admin_url('admin.php?page=bulkgate#/sign/in'))); 67 }); 68 add_action('wp_ajax_save_module_settings', function (): void 69 { 70 Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(PluginSettingsChange::class)->run($_POST['__bulkgate'] ?? [])); 71 }); 59 72 } 60 73 } -
woosms-sms-module-for-woocommerce/trunk/vendor/bulkgate/plugin/src/Event/Dispatcher.php
r2995624 r2999526 72 72 { 73 73 $language = $variables['lang_id'] ?? 'en'; 74 $s tore_id = $variables['store_id'] ?? 0;74 $shop_id = $variables['shop_id'] ?? 0; 75 75 $category = str_replace('-', '_', $category); 76 76 … … 80 80 } 81 81 82 foreach (["admin_sms-default-$s tore_id", "customer_sms-$language-$store_id"] as $scope)82 foreach (["admin_sms-default-$shop_id", "customer_sms-$language-$shop_id"] as $scope) 83 83 { 84 84 if ($category === 'order' && $endpoint === 'status_change' && isset($variables['order_status_id'])) -
woosms-sms-module-for-woocommerce/trunk/vendor/bulkgate/plugin/src/Event/Hook.php
r2995624 r2999526 41 41 $endpoint = str_replace('_', '-', $endpoint); 42 42 43 $this->send("api/$this->version/eshop/$category/$endpoint", [' variables' => $variables]);43 $this->send("api/$this->version/eshop/$category/$endpoint", ['language' => $variables['lang_id'] ?? null, 'shop_id' => $variables['shop_id'] ?? null, 'variables' => $variables]); 44 44 } 45 45 -
woosms-sms-module-for-woocommerce/trunk/vendor/composer/installed.json
r2995624 r2999526 3 3 { 4 4 "name": "bulkgate/plugin", 5 "version": "1.0.0 -RC6",6 "version_normalized": "1.0.0.0 -RC6",5 "version": "1.0.0", 6 "version_normalized": "1.0.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/BulkGate/plugin.git", 10 "reference": " 9484b1cecd9351d76ceb81b57b41cd809d46b5d8"10 "reference": "c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/BulkGate/plugin/zipball/ 9484b1cecd9351d76ceb81b57b41cd809d46b5d8",15 "reference": " 9484b1cecd9351d76ceb81b57b41cd809d46b5d8",14 "url": "https://api.github.com/repos/BulkGate/plugin/zipball/c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28", 15 "reference": "c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28", 16 16 "shasum": "" 17 17 }, … … 30 30 "tracy/tracy": "^2.9" 31 31 }, 32 "time": "2023-11- 13T15:14:11+00:00",32 "time": "2023-11-21T11:11:11+00:00", 33 33 "type": "library", 34 34 "installation-source": "dist", … … 48 48 "support": { 49 49 "issues": "https://github.com/BulkGate/plugin/issues", 50 "source": "https://github.com/BulkGate/plugin/tree/1.0.0 -RC6"50 "source": "https://github.com/BulkGate/plugin/tree/1.0.0" 51 51 }, 52 52 "install-path": "../bulkgate/plugin" -
woosms-sms-module-for-woocommerce/trunk/vendor/composer/installed.php
r2995624 r2999526 2 2 'root' => array( 3 3 'name' => 'bulkgate/woosms', 4 'pretty_version' => '3.0. 0',5 'version' => '3.0. 0.0',6 'reference' => ' 7f9900c9851243cf01e4ea2ec6dd982653f88795',4 'pretty_version' => '3.0.3', 5 'version' => '3.0.3.0', 6 'reference' => '0371d4f0ca9106920cf5d811833d6326370fb582', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'bulkgate/plugin' => array( 14 'pretty_version' => '1.0.0 -RC6',15 'version' => '1.0.0.0 -RC6',16 'reference' => ' 9484b1cecd9351d76ceb81b57b41cd809d46b5d8',14 'pretty_version' => '1.0.0', 15 'version' => '1.0.0.0', 16 'reference' => 'c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../bulkgate/plugin', … … 21 21 ), 22 22 'bulkgate/woosms' => array( 23 'pretty_version' => '3.0. 0',24 'version' => '3.0. 0.0',25 'reference' => ' 7f9900c9851243cf01e4ea2ec6dd982653f88795',23 'pretty_version' => '3.0.3', 24 'version' => '3.0.3.0', 25 'reference' => '0371d4f0ca9106920cf5d811833d6326370fb582', 26 26 'type' => 'project', 27 27 'install_path' => __DIR__ . '/../../', -
woosms-sms-module-for-woocommerce/trunk/woosms-sms-module-for-woocommerce.php
r2995942 r2999526 5 5 * Plugin URI: https://www.bulkgate.com/en/integrations/sms-plugin-for-woocommerce/ 6 6 * Description: Notify your customers about order status via SMS notifications. 7 * Version: 3.0. 27 * Version: 3.0.3 8 8 * Author: BulkGate 9 9 * Author URI: https://www.bulkgate.com/
Note: See TracChangeset
for help on using the changeset viewer.