mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added redirection to the 3rd-party URL alert;
This commit is contained in:
@@ -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 = '<a href="'. $value .'" title="'.$alt.'" target="'.$data['url_target'].'" ' . $url_rel . '>'.$alt.'</a>';
|
||||
$value = '<a href="'. esc_url( $value ) .'" title="' . esc_attr( $alt ) . '" target="' . esc_attr( $data['url_target'] ) . '" ' . $url_rel . $onclick_alert . '>' . esc_html( $alt ) . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user