Skip to content

Commit

Permalink
[FIX] catch warning emitted by fopen in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Apr 2, 2024
1 parent 7a45eee commit d946409
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ public function movePathToStorage(
?Closure $file_name_callback = null,
?Closure $revision_name_callback = null
): ?ResourceIdentification {
$open_path = fopen($absolute_path, 'rb');
try {
// in some cases fopen throws a warning instead of returning false
$open_path = fopen($absolute_path, 'rb');
} catch (Throwable $e) {
return null;
}

if ($open_path === false) {
return null;
}
Expand Down

0 comments on commit d946409

Please sign in to comment.