Skip to content

Commit 1f5e995

Browse files
committed
Fixed an issue caused by direct modification of fileId post meta in the database
1 parent 2c34a34 commit 1f5e995

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/pdf-ninja.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,10 @@ private function get_file_id( $attachment_id )
551551
$file_id = WPCF7_Pdf_Forms::get_meta( $attachment_id, 'file_id' );
552552
if( ! $file_id )
553553
{
554-
$file_id = substr($attachment_id . "-" . get_site_url(), 0, 40);
555-
return WPCF7_Pdf_Forms::set_meta( $attachment_id, 'file_id', $file_id );
554+
$file_id = substr( $attachment_id . "-" . get_site_url(), 0, 40 );
555+
WPCF7_Pdf_Forms::set_meta( $attachment_id, 'file_id', $file_id );
556556
}
557-
else
558-
return $file_id;
557+
return substr( $file_id, 0, 40 );
559558
}
560559

561560
/*

0 commit comments

Comments
 (0)