PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | square/helpers/FrmSquareLiteConnectHelper.php +11 -4 6.32.1 → trunk View file →
@@ -555,19 +555,26 @@
555 555 }
556 556
557 557 /**
558 558 * Check $_POST for live or test mode value as it can be updated in real time from Square Settings and can be configured before the update is saved.
559 + * The connect request sends a 'mode' string, and the disconnect request sends a 'testMode' flag, so check for both.
559 560 *
560 561 * @return string 'test' or 'live'
561 562 */
562 563 private static function get_mode_value_from_post() {
563 564 // phpcs:ignore WordPress.Security.NonceVerification.Missing
564 - if ( empty( $_POST ) || ! array_key_exists( 'testMode', $_POST ) ) {
565 - return FrmSquareLiteAppHelper::active_mode();
565 + if ( array_key_exists( 'mode', $_POST ) ) {
566 + $mode = FrmAppHelper::get_post_param( 'mode', '', 'sanitize_text_field' );
567 + return 'test' === $mode ? 'test' : 'live';
566 568 }
567 569
568 - $test_mode = FrmAppHelper::get_param( 'testMode', '', 'post', 'absint' );
569 - return $test_mode ? 'test' : 'live';
570 + // phpcs:ignore WordPress.Security.NonceVerification.Missing
571 + if ( array_key_exists( 'testMode', $_POST ) ) {
572 + $test_mode = FrmAppHelper::get_post_param( 'testMode', '', 'absint' );
573 + return $test_mode ? 'test' : 'live';
574 + }
575 +
576 + return FrmSquareLiteAppHelper::active_mode();
570 577 }
571 578
572 579 /**
573 580 * Get the standard body with account id, mode, and passwords to send to the connect server.