Skip to content

Commit 3153fd0

Browse files
committed
avoid warning "fpassthru() expects parameter 1 to be resource, ... given"
1 parent 2636a34 commit 3153fd0

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/collections/db/export-ead.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ function findingaid_DisplayContent($id, $objCollection, $readPermissions)
243243

244244
// deliver the zip file
245245
$fp = fopen("$tmp_zip","r");
246-
echo fpassthru($fp);
246+
if (is_resource($fp))
247+
echo fpassthru($fp);
247248

248249
// clean up the tmp zip file
249250
exec("rm $tmp_zip");

packages/collections/db/export-marc.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@
408408

409409
// deliver the zip file
410410
$fp = fopen("$tmp_zip","r");
411-
echo fpassthru($fp);
411+
if (is_resource($fp))
412+
echo fpassthru($fp);
412413

413414
// clean up the tmp zip file
414415
exec("rm $tmp_zip");

packages/creators/db/export-eac.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@
164164

165165
// deliver the zip file
166166
$fp = fopen("$tmp_zip","r");
167-
echo fpassthru($fp);
167+
if (is_resource($fp))
168+
echo fpassthru($fp);
168169

169170
// clean up the tmp zip file
170171
exec("rm $tmp_zip");

0 commit comments

Comments
 (0)