| @@ -284,8 +284,13 @@ | ||
| 284 | 284 | $options['before_html'] = isset( $values['options']['before_html'] ) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html( 'before' ); |
| 285 | 285 | $options['after_html'] = isset( $values['options']['after_html'] ) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html( 'after' ); |
| 286 | 286 | $options['submit_html'] = ( isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ) ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' ); |
| 287 | 287 | |
| 288 | + if ( ! empty( $options['success_url'] ) && ! empty( $args['form_id'] ) ) { | |
| 289 | + $options['success_url'] = FrmFormsHelper::maybe_add_sanitize_url_attr( $options['success_url'], (int) $args['form_id'] ); | |
| 290 | + $values['options']['success_url'] = $options['success_url']; | |
| 291 | + } | |
| 292 | + | |
| 288 | 293 | /** |
| 289 | 294 | * Allows modifying form options before updating or creating. |
| 290 | 295 | * |
| 291 | 296 | * @since 5.4 Added the third param. |
| @@ -365,18 +370,8 @@ | ||
| 365 | 370 | 'field_options' => $field->field_options, |
| 366 | 371 | 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
| 367 | 372 | ); |
| 368 | 373 | |
| 369 | - if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) { | |
| 370 | - foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) { | |
| 371 | - if ( is_array( $option ) ) { | |
| 372 | - foreach ( $option as $key => $item ) { | |
| 373 | - $values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' ); | |
| 374 | - } | |
| 375 | - } | |
| 376 | - } | |
| 377 | - } | |
| 378 | - | |
| 379 | 374 | self::prepare_field_update_values( $field, $values, $new_field ); |
| 380 | 375 | |
| 381 | 376 | FrmField::update( $field_id, $new_field ); |
| 382 | 377 | |
| @@ -687,11 +682,9 @@ | ||
| 687 | 682 | } |
| 688 | 683 | |
| 689 | 684 | $query_key = is_numeric( $id ) ? 'id' : 'form_key'; |
| 690 | 685 | $r = FrmDb::get_var( 'frm_forms', array( $query_key => $id ), 'name' ); |
| 691 | - | |
| 692 | - // An empty form name can result in a null value. | |
| 693 | - $r = is_null( $r ) ? '' : stripslashes( $r ); | |
| 686 | + $r = stripslashes( $r ); | |
| 694 | 687 | |
| 695 | 688 | return $r; |
| 696 | 689 | } |
| 697 | 690 | |