diff options
author | Erich Eckner <git@eckner.net> | 2020-04-03 21:51:45 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-04-03 21:51:45 +0200 |
commit | 46a7038a1e2c611a34edaf2b5802216563968fb1 (patch) | |
tree | 98779d43db309a459cda609f816103ad9557a6e3 | |
parent | c58b111af0c2853309968dd36fdff421de467b18 (diff) | |
download | sourceMirror-46a7038a1e2c611a34edaf2b5802216563968fb1.tar.xz |
mirror.php: delete 0-length files *before* handing them out
-rw-r--r-- | mirror.php | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -66,6 +66,12 @@ fwrite($al,date('Y-m-d H:i:s')." ".$pfad."\n"); fclose($al); + if (file_exists($pfad)) { + $stat = stat($pfad); + if ($stat['size'] == 0) + unlink($pfad); + } + if (! file_exists($pfad)) { passthru( "mkdir -p '".dirname($pfad)."'; ". |