summaryrefslogtreecommitdiff
path: root/mirror.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-03 21:51:45 +0200
committerErich Eckner <git@eckner.net>2020-04-03 21:51:45 +0200
commit46a7038a1e2c611a34edaf2b5802216563968fb1 (patch)
tree98779d43db309a459cda609f816103ad9557a6e3 /mirror.php
parentc58b111af0c2853309968dd36fdff421de467b18 (diff)
downloadsourceMirror-46a7038a1e2c611a34edaf2b5802216563968fb1.tar.xz
mirror.php: delete 0-length files *before* handing them out
Diffstat (limited to 'mirror.php')
-rw-r--r--mirror.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/mirror.php b/mirror.php
index 55f18e8..82fd4ae 100644
--- a/mirror.php
+++ b/mirror.php
@@ -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)."'; ".