Skip to content

Commit 71a7f6a

Browse files
author
jeldrik
committed
Prevent inconstitent /data/trafic_limiter.php due to file read while writing
1 parent 43fa904 commit 71a7f6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function trafic_limiter_canPass($ip)
3535
// FIXME: purge file of expired IPs to keep it small
3636
}
3737
$tl[$ip]=time();
38-
file_put_contents($tfilename, "<?php\n\$GLOBALS['trafic_limiter']=".var_export($tl,true).";\n?>");
38+
file_put_contents($tfilename, "<?php\n\$GLOBALS['trafic_limiter']=".var_export($tl,true).";\n?>", LOCK_EX);
3939
return true;
4040
}
4141

0 commit comments

Comments
 (0)