mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- probably fixed: #1084;
This commit is contained in:
@@ -87,7 +87,12 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
foreach ( $social as $k => $arr ) {
|
||||
if ( um_profile( $k ) ) {
|
||||
$match = is_array( $arr['match'] ) ? $arr['match'][0] : $arr['match']; ?>
|
||||
if ( array_key_exists( 'match' , $arr ) ) {
|
||||
$match = is_array( $arr['match'] ) ? $arr['match'][0] : $arr['match'];
|
||||
} else {
|
||||
$match = null;
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( um_filtered_social_link( $k, $match ) ); ?>"
|
||||
style="background: <?php echo esc_attr( $arr['color'] ); ?>;" target="_blank" class="um-tip-n"
|
||||
|
||||
@@ -915,18 +915,20 @@ function um_user_submited_display( $k, $title, $data = array(), $style = true )
|
||||
* Show filtered social link
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $match
|
||||
* @param null|string $match
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function um_filtered_social_link( $key, $match ) {
|
||||
function um_filtered_social_link( $key, $match = null ) {
|
||||
$value = um_profile( $key );
|
||||
$submatch = str_replace( 'https://', '', $match );
|
||||
$submatch = str_replace( 'http://', '', $submatch );
|
||||
if ( strstr( $value, $submatch ) ) {
|
||||
$value = 'https://' . $value;
|
||||
} elseif ( strpos( $value, 'http' ) !== 0 ) {
|
||||
$value = $match . $value;
|
||||
if ( ! empty( $match ) ) {
|
||||
$submatch = str_replace( 'https://', '', $match );
|
||||
$submatch = str_replace( 'http://', '', $submatch );
|
||||
if ( strstr( $value, $submatch ) ) {
|
||||
$value = 'https://' . $value;
|
||||
} elseif ( strpos( $value, 'http' ) !== 0 ) {
|
||||
$value = $match . $value;
|
||||
}
|
||||
}
|
||||
$value = str_replace( 'https://https://', 'https://', $value );
|
||||
$value = str_replace( 'http://https://', 'https://', $value );
|
||||
|
||||
Reference in New Issue
Block a user