mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 13:13:33 +09:00
- fixed #1085;
This commit is contained in:
@@ -657,19 +657,47 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
$v = sanitize_text_field( $form[ $k ] );
|
||||
|
||||
// Make a proper social link
|
||||
if ( ! empty( $v ) && ! strstr( $v, $f['match'] ) ) {
|
||||
$domain = trim( strtr( $f['match'], array(
|
||||
'https://' => '',
|
||||
'http://' => '',
|
||||
) ), ' /' );
|
||||
if ( ! empty( $v ) ) {
|
||||
$replace_match = is_array( $f['match'] ) ? $f['match'][0] : $f['match'];
|
||||
|
||||
if ( ! strstr( $v, $domain ) ) {
|
||||
$v = $f['match'] . $v;
|
||||
} else {
|
||||
$v = 'https://' . trim( strtr( $v, array(
|
||||
'https://' => '',
|
||||
'http://' => '',
|
||||
) ), ' /' );
|
||||
$need_replace = false;
|
||||
if ( is_array( $f['match'] ) ) {
|
||||
$need_replace = true;
|
||||
foreach ( $f['match'] as $arr_match ) {
|
||||
if ( strstr( $v, $arr_match ) ) {
|
||||
$need_replace = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_array( $f['match'] ) || $need_replace ) {
|
||||
if ( ! strstr( $v, $replace_match ) ) {
|
||||
$domain = trim(
|
||||
strtr(
|
||||
$replace_match,
|
||||
array(
|
||||
'https://' => '',
|
||||
'http://' => '',
|
||||
)
|
||||
),
|
||||
' /'
|
||||
);
|
||||
|
||||
if ( ! strstr( $v, $domain ) ) {
|
||||
$v = $replace_match . $v;
|
||||
} else {
|
||||
$v = 'https://' . trim(
|
||||
strtr(
|
||||
$v,
|
||||
array(
|
||||
'https://' => '',
|
||||
'http://' => '',
|
||||
)
|
||||
),
|
||||
' /'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user