Skip to content

Commit 5ad263b

Browse files
committed
Added error check
1 parent d3fe0a7 commit 5ad263b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdf-forms-for-contact-form-7.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,8 @@ public function fill_pdfs( $contact_form, &$abort, $submission )
10541054
if( $parsed !== false )
10551055
{
10561056
$url_mimetype = $parsed['mime'];
1057-
file_put_contents( $filepath, $parsed['data'] );
1057+
if( file_put_contents( $filepath, $parsed['data'] ) === false || ! is_file( $filepath ) )
1058+
throw new Exception( __( "Failed to create file", 'pdf-forms-for-contact-form-7' ) );
10581059
}
10591060
}
10601061
}

0 commit comments

Comments
 (0)