PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.2.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.2.02
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 -19 6.25.15.2.02 View file →
@@ -12,17 +12,10 @@
12 12 * @var string
13 13 * @since 3.0
14 14 */
15 15 protected $type = 'url';
16 + protected $display_type = 'text';
16 17
17 - /**
18 - * @var bool
19 - */
20 - protected $array_allowed = false;
21 -
22 - /**
23 - * @return bool[]
24 - */
25 18 protected function field_settings_for_type() {
26 19 return array(
27 20 'size' => true,
28 21 'clear_on_focus' => true,
@@ -39,18 +32,12 @@
39 32 'show_image' => 0,
40 33 );
41 34 }
42 35
43 - /**
44 - * @return string
45 - */
46 36 protected function get_field_name() {
47 37 return __( 'Website', 'formidable' );
48 38 }
49 39
50 - /**
51 - * @return void
52 - */
53 40 protected function fill_default_atts( &$atts ) {
54 41 $defaults = array(
55 42 'sep' => ', ',
56 43 'html' => false,
@@ -63,13 +50,13 @@
63 50 }
64 51
65 52 public function validate( $args ) {
66 53 $value = $args['value'];
67 - if ( trim( $value ) === 'http://' || empty( $value ) ) {
54 + if ( trim( $value ) == 'http://' || empty( $value ) ) {
68 55 $value = '';
69 56 } else {
70 57 $value = esc_url_raw( $value );
71 - $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;
72 59 }
73 60
74 61 FrmEntriesHelper::set_posted_value( $this->field, $value, $args );
75 62
@@ -91,9 +78,9 @@
91 78 foreach ( (array) $value as $url ) {
92 79 $image_regex = '/(\.(?i)(jpg|jpeg|png|gif))$/';
93 80 $is_image = preg_match( $image_regex, $url );
94 81 if ( $is_image ) {
95 - $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="" /> ';
96 83 } else {
97 84 $images .= strip_tags( $url );
98 85 }
99 86 }
@@ -104,10 +91,8 @@
104 91 }
105 92
106 93 /**
107 94 * @since 4.0.04
108 - *
109 - * @return void
110 95 */
111 96 public function sanitize_value( &$value ) {
112 97 FrmAppHelper::sanitize_value( 'esc_url_raw', $value );
113 98 }