| @@ -14,13 +14,8 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | protected $type = 'url'; |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * @var string | |
| 19 | - */ | |
| 20 | - protected $display_type = 'text'; | |
| 21 | - | |
| 22 | - /** | |
| 23 | 18 | * @var bool |
| 24 | 19 | */ |
| 25 | 20 | protected $array_allowed = false; |
| 26 | 21 | |
| @@ -68,9 +63,9 @@ | ||
| 68 | 63 | } |
| 69 | 64 | |
| 70 | 65 | public function validate( $args ) { |
| 71 | 66 | $value = $args['value']; |
| 72 | - if ( trim( $value ) == 'http://' || empty( $value ) ) { | |
| 67 | + if ( trim( $value ) === 'http://' || empty( $value ) ) { | |
| 73 | 68 | $value = ''; |
| 74 | 69 | } else { |
| 75 | 70 | $value = esc_url_raw( $value ); |
| 76 | 71 | $value = preg_match( '/^(https?|ftps?|mailto|news|feed|telnet):/is', $value ) ? $value : 'http://' . $value; |
| @@ -96,9 +91,9 @@ | ||
| 96 | 91 | foreach ( (array) $value as $url ) { |
| 97 | 92 | $image_regex = '/(\.(?i)(jpg|jpeg|png|gif))$/'; |
| 98 | 93 | $is_image = preg_match( $image_regex, $url ); |
| 99 | 94 | if ( $is_image ) { |
| 100 | - $images .= '<img src="' . esc_attr( $url ) . '" class="frm_image_from_url" alt="" /> '; | |
| 95 | + $images .= '<img src="' . esc_url( $url ) . '" class="frm_image_from_url" alt="" /> '; | |
| 101 | 96 | } else { |
| 102 | 97 | $images .= strip_tags( $url ); |
| 103 | 98 | } |
| 104 | 99 | } |