Skip to content

Commit

Permalink
Version bump to 2.1.7
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 11b8c0e
Author: Prajwol <[email protected]>
Date:   Wed Apr 27 13:06:37 2022 +0545

    Fix - Modal CSS issues fixed

commit dd359f1
Author: Lekhnath Pandey <[email protected]>
Date:   Wed Apr 27 12:40:28 2022 +0545

    Fix - Multiple form invisible recaptcha issue

commit 6cbc319
Merge: a46bbb1 db54f0b
Author: Prajjwal Poudel <[email protected]>
Date:   Wed Apr 27 09:06:28 2022 +0545

    Merge branch 'fix/country-full-name-in-email' into develop

commit a46bbb1
Author: Prajjwal Poudel <[email protected]>
Date:   Wed Apr 27 09:02:07 2022 +0545

    Fix - Bypass prevent core reset password on multisite

commit db54f0b
Author: Lekhnath Pandey <[email protected]>
Date:   Wed Apr 27 08:41:32 2022 +0545

    Fix - Country full name in smart tags

commit da48e09
Author: Prajjwal Poudel <[email protected]>
Date:   Tue Apr 26 14:19:31 2022 +0545

    Fix - Wrong sanitization for valid extensions in profile pic
  • Loading branch information
iamprazol committed Apr 27, 2022
1 parent 226a118 commit 1235ea2
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 63 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
= 2.1.7 - 27/04/2022
* Tweak - Country full name in smart tags.
* Fix - Multiple form invisible recaptcha issue.
* Fix - Wrong label of save changes button in settings.
* Fix - Bypass prevent core reset password on multisite.
* Fix - Wrong sanitization for valid extensions in profile pic.

= 2.1.6 - 20/04/2022
* Enhance - Active status on emails settings.
* Enhance - Keyboard shortcut in form builder.
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/components/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
background: $white;
position: relative;
width: auto;
margin: 16px;
border-radius: 8px;
z-index: 99999;
box-shadow: 0 3px 25px 0px transparentize($gray_base, 0.6);
margin: 16px;
@media (min-width: 576px) {
max-width: 500px;
margin: 24px auto;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/user-registration-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/user-registration.css

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions assets/js/frontend/user-registration-recaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ var onloadURCallback = function () {
}
);
}
}
if ("yes" === ur_recaptcha_code.is_invisible) {
grecaptcha.execute();
if ("yes" === ur_recaptcha_code.is_invisible) {
grecaptcha.execute(google_recaptcha_user_registration);
}
}
}
});
Expand Down Expand Up @@ -181,9 +181,9 @@ var onloadURCallback = function () {
}
);
}
}
if ("yes" === ur_recaptcha_code.is_invisible) {
grecaptcha.execute();
if ("yes" === ur_recaptcha_code.is_invisible) {
grecaptcha.execute(google_recaptcha_login);
}
}
}
});
Expand All @@ -204,10 +204,6 @@ function request_recaptcha_token() {
jQuery("form.register")
.find("#g-recaptcha-response")
.text(token);

var captchaResponse = jQuery("form.register")
.find('[name="g-recaptcha-response"]')
.val();
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/user-registration-recaptcha.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion includes/admin/settings/class-ur-settings-license.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ public function __construct() {
add_action( 'user_registration_sections_' . $this->id, array( $this, 'output_sections' ) );
add_action( 'user_registration_settings_' . $this->id, array( $this, 'output' ) );
add_filter( 'show_user_registration_setting_message', array( $this, 'filter_notice' ) );
add_filter( 'user_registration_setting_save_label', array( $this, 'user_registration_license_setting_label' ) );

if ( isset( $_GET['tab'] ) && 'license' === $_GET['tab'] ) { // phpcs:ignore
add_filter( 'user_registration_setting_save_label', array( $this, 'user_registration_license_setting_label' ) );
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions includes/class-ur-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public static function profile_pic_upload() {
$upload = isset( $_FILES['file'] ) ? $_FILES['file'] : array(); // phpcs:ignore

// valid extension for image.
$valid_extensions = isset( $_REQUEST['valid_extension'] ) ? wp_unslash( sanitize_key( $_REQUEST['valid_extension'] ) ) : '';
$valid_extensions = isset( $_REQUEST['valid_extension'] ) ? wp_unslash( $_REQUEST['valid_extension'] ) : ''; // phpcs:ignore
$valid_extension_type = explode( ',', $valid_extensions );
$valid_ext = array();

Expand Down Expand Up @@ -596,10 +596,10 @@ public static function ajax_login_submit() {
$user->errors['denied_access'][0] = sprintf( '<strong>%s:</strong> %s', __( 'ERROR', 'user-registration' ), $messages['denied_access'] );
}
if ( ! empty( $user->errors['invalid_email'] ) ) {
$user->errors['invalid_email'][0] = apply_filters( "user_registration_invalid_email_error_message", sprintf( '<strong>%s:</strong> %s', __( 'ERROR', 'user-registration' ), __( 'Unknown email address. Check again or try your username.', 'user-registration' ) ) );
$user->errors['invalid_email'][0] = apply_filters( 'user_registration_invalid_email_error_message', sprintf( '<strong>%s:</strong> %s', __( 'ERROR', 'user-registration' ), __( 'Unknown email address. Check again or try your username.', 'user-registration' ) ) );
}
if ( ! empty( $user->errors['incorrect_password'] ) ) {
$user->errors['incorrect_password'][0] = apply_filters( "user_registration_incorrect_password_error_message", sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'The password you entered for username %1$1s is incorrect. %2$2s', 'user-registration' ), $info['user_login'], "<a href='" . esc_url( wp_lostpassword_url() ) . "'>" . __( 'Lost Your Password?', 'user-registration' ) . '</a>' ) );
$user->errors['incorrect_password'][0] = apply_filters( 'user_registration_incorrect_password_error_message', sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'The password you entered for username %1$1s is incorrect. %2$2s', 'user-registration' ), $info['user_login'], "<a href='" . esc_url( wp_lostpassword_url() ) . "'>" . __( 'Lost Your Password?', 'user-registration' ) . '</a>' ) );
}
$message = $user->get_error_message();
wp_send_json_error( array( 'message' => $message ) );
Expand Down
5 changes: 5 additions & 0 deletions includes/class-ur-emailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ public static function ur_profile_details_changed_mail( $user_id, $form_id ) {
$value = implode( ',',$upload_data );
}
}
if ( 'country' === $form_data['field_key'] && '' !== $value ) {
$country_class = ur_load_form_field_class( $form_data['field_key'] );
$countries = $country_class::get_instance()->get_country();
$value = isset( $countries[ $value ] ) ? $countries[ $value ] : $value;
}
// @codingStandardsIgnoreEnd

$data_html .= $form_data['label'] . ' : ' . $value . '<br/>';
Expand Down
6 changes: 6 additions & 0 deletions includes/frontend/class-ur-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ public function prevent_core_login_page() {
}

if ( ! ( defined( 'UR_DISABLE_PREVENT_CORE_LOGIN' ) && true === UR_DISABLE_PREVENT_CORE_LOGIN ) && 'yes' === get_option( 'user_registration_login_options_prevent_core_login', 'no' ) && 1 <= absint( $matched ) ) {

// Redirect to core login reset password page on multisite.
if ( is_multisite() && ( 'lostpassword' === $action || 'resetpass' === $action ) ) {
return;
}

if ( 'register' === $action || 'login' === $action || 'lostpassword' === $action || 'resetpass' === $action ) {
$myaccount_page = apply_filters( 'user_registration_myaccount_redirect_url', get_permalink( $page_id ), $page_id );
wp_safe_redirect( $myaccount_page );
Expand Down
6 changes: 6 additions & 0 deletions includes/functions-ur-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,12 @@ function ur_parse_name_values_for_smart_tags( $user_id, $form_id, $valid_form_da
$form_data->value = $upload_data;
}

if ( isset( $form_data->extra_params['field_key'] ) && 'country' === $form_data->extra_params['field_key'] && '' !== $form_data->value ) {
$country_class = ur_load_form_field_class( $form_data->extra_params['field_key'] );
$countries = $country_class::get_instance()->get_country();
$form_data->value = isset( $countries[ $form_data->value ] ) ? $countries[ $form_data->value ] : $form_data->value;
}

$label = isset( $form_data->extra_params['label'] ) ? $form_data->extra_params['label'] : '';
$field_name = isset( $form_data->field_name ) ? $form_data->field_name : '';
$value = isset( $form_data->value ) ? $form_data->value : '';
Expand Down
Loading

0 comments on commit 1235ea2

Please sign in to comment.