diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php
index 4b14a2db..b62854ab 100644
--- a/includes/core/um-filters-fields.php
+++ b/includes/core/um-filters-fields.php
@@ -424,8 +424,17 @@ function um_profile_field_filter_hook__( $value, $data, $type = '' ) {
if ( strpos( $value, 'http://' ) !== 0 ) {
$value = 'http://' . $value;
}
+
+ $value = str_replace('https://https://','https://',$value);
+ $value = str_replace('http://https://','https://',$value);
+
+ $onclick_alert = '';
+ if ( $value !== wp_validate_redirect( $value ) ) {
+ $onclick_alert = ' onclick="return confirm( \'' . sprintf( __( 'This link leads to a 3rd-party website. Make sure the link is safe and you really want to go to this website: `%s`', 'ultimate-member' ), $value ) . '\' );"';
+ }
+
$data['url_target'] = ( isset( $data['url_target'] ) ) ? $data['url_target'] : '_blank';
- $value = ''.$alt.'';
+ $value = '' . esc_html( $alt ) . '';
}
}