Skip to content

Commit

Permalink
Merge pull request sebsauvage#61 from jelhan/master
Browse files Browse the repository at this point in the history
File lock for write on /data/traffic_limiter.php
  • Loading branch information
sebsauvage committed Feb 3, 2014
2 parents 4f8750b + 71a7f6a commit 09d39a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function trafic_limiter_canPass($ip)
// FIXME: purge file of expired IPs to keep it small
}
$tl[$ip]=time();
file_put_contents($tfilename, "<?php\n\$GLOBALS['trafic_limiter']=".var_export($tl,true).";\n?>");
file_put_contents($tfilename, "<?php\n\$GLOBALS['trafic_limiter']=".var_export($tl,true).";\n?>", LOCK_EX);
return true;
}

Expand Down

0 comments on commit 09d39a9

Please sign in to comment.