[Xfce4-commits] <forum:master> Store the time to avoid skipped days at 0:00:00.

Nick Schermer noreply at xfce.org
Fri Nov 12 18:40:01 CET 2010


Updating branch refs/heads/master
         to a029c20b24644d5541800616e22215f11562841b (commit)
       from e27283b1b56885d9b70358e48582ed6c5f084160 (commit)

commit a029c20b24644d5541800616e22215f11562841b
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Nov 12 18:36:00 2010 +0100

    Store the time to avoid skipped days at 0:00:00.

 include/sha256question.php |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/sha256question.php b/include/sha256question.php
index df75690..1c5101e 100644
--- a/include/sha256question.php
+++ b/include/sha256question.php
@@ -42,10 +42,11 @@ function sha256question_check()
 
 	// Because the user might be in a different time zone, or day changed right
 	// after submit, we also check the hash of yesterday and tomorrow.
+	$timstamp = time();
 	foreach (array (0, 1, -1) as $i)
 	{
 		// The date command adds a new line at the end
-		$str = gmstrftime ($question_format, time() - ($i * 60*60*24)) ."\n";
+		$str = gmstrftime ($question_format, $timstamp - ($i * 60*60*24)) ."\n";
 		$answer = hash ("sha256", $str);
 
 		if (sha256question_normalize ($answer) == $user_answer)



More information about the Xfce4-commits mailing list