| @@ -152,9 +152,9 @@ | ||
| 152 | 152 | //replace [key] |
| 153 | 153 | $this->html = str_replace( '[key]', $this->field_obj->get_field_column( 'field_key' ), $this->html ); |
| 154 | 154 | |
| 155 | 155 | //replace [field_name] |
| 156 | - $this->html = str_replace( '[field_name]', FrmAppHelper::maybe_kses( $this->field_obj->get_field_column( 'name' ) ), $this->html ); | |
| 156 | + $this->html = str_replace( '[field_name]', $this->field_obj->get_field_column( 'name' ), $this->html ); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * @since 3.0 |
| @@ -182,9 +182,9 @@ | ||
| 182 | 182 | * @since 3.0 |
| 183 | 183 | */ |
| 184 | 184 | private function replace_description_shortcode() { |
| 185 | 185 | $this->maybe_add_description_id(); |
| 186 | - $description = FrmAppHelper::maybe_kses( $this->field_obj->get_field_column( 'description' ) ); | |
| 186 | + $description = $this->field_obj->get_field_column( 'description' ); | |
| 187 | 187 | FrmShortcodeHelper::remove_inline_conditions( ( $description && $description != '' ), 'description', $description, $this->html ); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| @@ -229,42 +229,12 @@ | ||
| 229 | 229 | */ |
| 230 | 230 | private function replace_error_shortcode() { |
| 231 | 231 | $this->maybe_add_error_id(); |
| 232 | 232 | $error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false; |
| 233 | - | |
| 234 | - if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { | |
| 235 | - $error_body = self::get_error_body( $this->html ); | |
| 236 | - if ( is_string( $error_body ) && false === strpos( $error_body, 'role=' ) ) { | |
| 237 | - $new_error_body = preg_replace( '/class="frm_error/', 'role="alert" class="frm_error', $error_body, 1 ); | |
| 238 | - $this->html = str_replace( '[if error]' . $error_body . '[/if error]', '[if error]' . $new_error_body . '[/if error]', $this->html ); | |
| 239 | - } | |
| 240 | - } | |
| 241 | - | |
| 242 | 233 | FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html ); |
| 243 | 234 | } |
| 244 | 235 | |
| 245 | 236 | /** |
| 246 | - * Pull the HTML between [if error] and [/if error] shortcodes. | |
| 247 | - * | |
| 248 | - * @param string $html | |
| 249 | - * @return string|false | |
| 250 | - */ | |
| 251 | - private static function get_error_body( $html ) { | |
| 252 | - $start = strpos( $html, '[if error]' ); | |
| 253 | - if ( false === $start ) { | |
| 254 | - return false; | |
| 255 | - } | |
| 256 | - | |
| 257 | - $end = strpos( $html, '[/if error]', $start ); | |
| 258 | - if ( false === $end ) { | |
| 259 | - return false; | |
| 260 | - } | |
| 261 | - | |
| 262 | - $error_body = substr( $html, $start + 10, $end - $start - 10 ); | |
| 263 | - return $error_body; | |
| 264 | - } | |
| 265 | - | |
| 266 | - /** | |
| 267 | 237 | * Add an ID to the error message for aria-describedby. |
| 268 | 238 | * This ID was added to the HTML in v3.06.02. |
| 269 | 239 | * |
| 270 | 240 | * @since 3.06.02 |
| @@ -408,8 +378,11 @@ | ||
| 408 | 378 | */ |
| 409 | 379 | private function add_class_to_label() { |
| 410 | 380 | $label_class = $this->field_obj->get_label_class(); |
| 411 | 381 | $this->html = str_replace( '[label_position]', $label_class, $this->html ); |
| 382 | + if ( $this->field_obj->get_field_column( 'label' ) == 'inside' && $this->field_obj->get_field_column( 'value' ) != '' ) { | |
| 383 | + $this->html = str_replace( 'frm_primary_label', 'frm_primary_label frm_visible', $this->html ); | |
| 384 | + } | |
| 412 | 385 | } |
| 413 | 386 | |
| 414 | 387 | /** |
| 415 | 388 | * Replace [entry_key] |
| @@ -449,15 +422,9 @@ | ||
| 449 | 422 | |
| 450 | 423 | // Add label position class |
| 451 | 424 | $settings = $this->field_obj->display_field_settings(); |
| 452 | 425 | if ( isset( $settings['label_position'] ) && $settings['label_position'] ) { |
| 453 | - $label_position = $this->field_obj->get_field_column( 'label' ); | |
| 454 | - $classes .= ' frm_' . $label_position . '_container'; | |
| 455 | - | |
| 456 | - // Add class if field has value, to be used for floating label styling. | |
| 457 | - if ( 'inside' === $label_position && $this->field_obj->get_field_column( 'value' ) ) { | |
| 458 | - $classes .= ' frm_label_float_top'; | |
| 459 | - } | |
| 426 | + $classes .= ' frm_' . $this->field_obj->get_field_column( 'label' ) . '_container'; | |
| 460 | 427 | } |
| 461 | 428 | |
| 462 | 429 | // Add CSS layout classes |
| 463 | 430 | $extra_classes = $this->field_obj->get_field_column( 'classes' ); |