Skip to content

Commit 88d3d32

Browse files
committed
esc values going into the sheet, fix json encode flag requirement
1 parent dc9401f commit 88d3d32

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

projects/packages/forms/src/contact-form/class-contact-form-plugin.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,7 +3679,8 @@ public function export_to_gdrive() {
36793679
) {
36803680
wp_send_json_error(
36813681
__( 'You aren\'t authorized to do that.', 'jetpack-forms' ),
3682-
403
3682+
403,
3683+
JSON_UNESCAPED_SLASHES
36833684
);
36843685
return;
36853686
}
@@ -3701,7 +3702,7 @@ public function export_to_gdrive() {
37013702
*/
37023703
foreach ( $fields as $single_field_name ) {
37033704
if ( isset( $export_data[ $single_field_name ][ $i ] ) ) {
3704-
$current_row[] = $export_data[ $single_field_name ][ $i ];
3705+
$current_row[] = $this->esc_csv( $export_data[ $single_field_name ][ $i ] );
37053706
} else {
37063707
$current_row[] = '';
37073708
}
@@ -3730,7 +3731,9 @@ public function export_to_gdrive() {
37303731
array(
37313732
'success' => ! is_wp_error( $sheet ),
37323733
'data' => $sheet,
3733-
)
3734+
),
3735+
is_wp_error( $sheet ) ? 500 : 200,
3736+
JSON_UNESCAPED_SLASHES
37343737
);
37353738
}
37363739
}

0 commit comments

Comments
 (0)