PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/fields/FrmFieldUrl.php +4 -28 6.265.0 View file →
@@ -9,21 +9,13 @@
9 9 class FrmFieldUrl extends FrmFieldType {
10 10
11 11 /**
12 12 * @var string
13 - *
14 13 * @since 3.0
15 14 */
16 15 protected $type = 'url';
16 + protected $display_type = 'text';
17 17
18 - /**
19 - * @var bool
20 - */
21 - protected $array_allowed = false;
22 -
23 - /**
24 - * @return bool[]
25 - */
26 18 protected function field_settings_for_type() {
27 19 return array(
28 20 'size' => true,
29 21 'clear_on_focus' => true,
@@ -40,20 +32,12 @@
40 32 'show_image' => 0,
41 33 );
42 34 }
43 35
44 - /**
45 - * @return string
46 - */
47 36 protected function get_field_name() {
48 37 return __( 'Website', 'formidable' );
49 38 }
50 39
51 - /**
52 - * @param array $atts
53 - *
54 - * @return void
55 - */
56 40 protected function fill_default_atts( &$atts ) {
57 41 $defaults = array(
58 42 'sep' => ', ',
59 43 'html' => false,
@@ -66,14 +50,13 @@
66 50 }
67 51
68 52 public function validate( $args ) {
69 53 $value = $args['value'];
70 -
71 - if ( trim( $value ) === 'http://' || empty( $value ) ) {
54 + if ( trim( $value ) == 'http://' || empty( $value ) ) {
72 55 $value = '';
73 56 } else {
74 57 $value = esc_url_raw( $value );
75 - $value = preg_match( '/^(https?|ftps?|mailto|news|feed|telnet):/is', $value ) ? $value : 'https://' . $value;
58 + $value = preg_match( '/^(https?|ftps?|mailto|news|feed|telnet):/is', $value ) ? $value : 'http://' . $value;
76 59 }
77 60
78 61 FrmEntriesHelper::set_posted_value( $this->field, $value, $args );
79 62
@@ -91,20 +74,17 @@
91 74
92 75 protected function prepare_display_value( $value, $atts ) {
93 76 if ( $atts['html'] ) {
94 77 $images = '';
95 -
96 78 foreach ( (array) $value as $url ) {
97 79 $image_regex = '/(\.(?i)(jpg|jpeg|png|gif))$/';
98 80 $is_image = preg_match( $image_regex, $url );
99 -
100 81 if ( $is_image ) {
101 - $images .= '<img src="' . esc_url( $url ) . '" class="frm_image_from_url" alt="" /> ';
82 + $images .= '<img src="' . esc_attr( $url ) . '" class="frm_image_from_url" alt="" /> ';
102 83 } else {
103 84 $images .= strip_tags( $url );
104 85 }
105 86 }
106 -
107 87 $value = $images;
108 88 }
109 89
110 90 return $value;
@@ -111,12 +91,8 @@
111 91 }
112 92
113 93 /**
114 94 * @since 4.0.04
115 - *
116 - * @param array|string $value
117 - *
118 - * @return void
119 95 */
120 96 public function sanitize_value( &$value ) {
121 97 FrmAppHelper::sanitize_value( 'esc_url_raw', $value );
122 98 }