Changeset 2732620
- Timestamp:
- 05/27/2022 12:05:31 PM (4 years ago)
- Location:
- co2ok-for-woocommerce
- Files:
-
- 2 edited
-
tags/1.0.9.22/Components/Admin/Co2ok-AdminOverview.php (modified) (4 diffs)
-
trunk/Components/Admin/Co2ok-AdminOverview.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
co2ok-for-woocommerce/tags/1.0.9.22/Components/Admin/Co2ok-AdminOverview.php
r2729525 r2732620 51 51 { 52 52 $returnValue = ''; 53 if ( $setting == 'co2ok_optout' || 'co2ok_cfp' || 'co2ok_gif_feature' || 'co2ok_ab_research' || 'co2ok_widgetmark_footer') {53 if (in_array($setting, ['co2ok_optout', 'co2ok_cfp', 'co2ok_gif_feature', 'co2ok_ab_research', 'co2ok_widgetmark_footer'], true)) { 54 54 if ($input == 'on' || $input == 'off') { 55 55 $returnValue = $input; … … 58 58 } 59 59 } else if ($setting == 'co2ok_checkout_placement') { 60 if ( $input == 'after_order_notes' || 'before_checkout_form' || 'checkout_before_customer_details' || 'after_checkout_billing_form' || 'checkout_order_review') {60 if (in_array($input, ['after_order_notes', 'before_checkout_form', 'checkout_before_customer_details', 'after_checkout_billing_form', 'checkout_order_review'], true)) { 61 61 $returnValue = $input; 62 62 } else { … … 64 64 } 65 65 } else if ($setting == 'co2ok_button_template') { 66 if ( $input == 'co2ok_button_template_default' || 'co2ok_button_template_minimal') {66 if (in_array($input, ['co2ok_button_template_default', 'co2ok_button_template_minimal'])) { 67 67 $returnValue = $input; 68 68 } else { 69 69 $returnValue = 'co2ok_button_template_default'; 70 } 71 } else if ($setting == 'co2ok_disable_button_on_cart') { 72 if ($input == 'true' || $input == 'false') { 73 $returnValue = $input; 74 } else { 75 $returnValue = 'false'; 70 76 } 71 77 } … … 114 120 if (isset($_GET['co2ok_disable_button_on_cart'])) 115 121 { 116 update_option('co2ok_disable_button_on_cart', $ _GET['co2ok_disable_button_on_cart']);122 update_option('co2ok_disable_button_on_cart', $this->validate_setting_input('co2ok_disable_button_on_cart', sanitize_key($_GET['co2ok_disable_button_on_cart']))); 117 123 } 118 124 -
co2ok-for-woocommerce/trunk/Components/Admin/Co2ok-AdminOverview.php
r2729525 r2732620 51 51 { 52 52 $returnValue = ''; 53 if ( $setting == 'co2ok_optout' || 'co2ok_cfp' || 'co2ok_gif_feature' || 'co2ok_ab_research' || 'co2ok_widgetmark_footer') {53 if (in_array($setting, ['co2ok_optout', 'co2ok_cfp', 'co2ok_gif_feature', 'co2ok_ab_research', 'co2ok_widgetmark_footer'], true)) { 54 54 if ($input == 'on' || $input == 'off') { 55 55 $returnValue = $input; … … 58 58 } 59 59 } else if ($setting == 'co2ok_checkout_placement') { 60 if ( $input == 'after_order_notes' || 'before_checkout_form' || 'checkout_before_customer_details' || 'after_checkout_billing_form' || 'checkout_order_review') {60 if (in_array($input, ['after_order_notes', 'before_checkout_form', 'checkout_before_customer_details', 'after_checkout_billing_form', 'checkout_order_review'], true)) { 61 61 $returnValue = $input; 62 62 } else { … … 64 64 } 65 65 } else if ($setting == 'co2ok_button_template') { 66 if ( $input == 'co2ok_button_template_default' || 'co2ok_button_template_minimal') {66 if (in_array($input, ['co2ok_button_template_default', 'co2ok_button_template_minimal'])) { 67 67 $returnValue = $input; 68 68 } else { 69 69 $returnValue = 'co2ok_button_template_default'; 70 } 71 } else if ($setting == 'co2ok_disable_button_on_cart') { 72 if ($input == 'true' || $input == 'false') { 73 $returnValue = $input; 74 } else { 75 $returnValue = 'false'; 70 76 } 71 77 } … … 114 120 if (isset($_GET['co2ok_disable_button_on_cart'])) 115 121 { 116 update_option('co2ok_disable_button_on_cart', $ _GET['co2ok_disable_button_on_cart']);122 update_option('co2ok_disable_button_on_cart', $this->validate_setting_input('co2ok_disable_button_on_cart', sanitize_key($_GET['co2ok_disable_button_on_cart']))); 117 123 } 118 124
Note: See TracChangeset
for help on using the changeset viewer.