We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c0aeee commit 0726f19Copy full SHA for 0726f19
log/humor.pl
@@ -8,7 +8,11 @@
8
open FLOOD_CONTROL_FILE, '+<', 'humor/flood_control' or die "No flood control file writable.\n";
9
10
#flood control time
11
-if ( time < (readline(FLOOD_CONTROL_FILE) + $FLOOD_SECS) ) { # I hope that file contains what I think it does
+my $last_time = readline(FLOOD_CONTROL_FILE);
12
+if ($last_time < 1) {
13
+ die "Invalid file: humor/flood_control";
14
+}
15
+if ( time < $last_time + $FLOOD_SECS ) {
16
exit 0;
17
}
18
0 commit comments