Plugin Directory

Changeset 2624111


Ignore:
Timestamp:
11/03/2021 03:34:57 PM (4 years ago)
Author:
mmuro
Message:

Prepend a space to values to prevent CSV injection attacks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • visual-form-builder/trunk/admin/class-export.php

    r2623700 r2624111  
    301301            foreach ( $fields_clean as $label ) {
    302302                $label = wp_specialchars_decode( $label );
    303                 $rows[ $label ] =  ( isset( $row[ $label ] ) && in_array( $label, $fields_clean ) ) ? esc_html( $row[ $label ] ) : '';
     303                // Prepend a space to prevent CSV injection attacks
     304                $value = ' ' . wp_specialchars_decode( $row[ $label ] );
     305
     306                $rows[ $label ] =  ( isset( $row[ $label ] ) && in_array( $label, $fields_clean ) ) ? $value : '';
    304307            }
    305308
Note: See TracChangeset for help on using the changeset viewer.