[dw-free] self-expiring promo codes
[commit: http://hg.dwscoalition.org/dw-free/rev/b3ab77b750fd]
http://bugs.dwscoalition.org/show_bug.cgi?id=3386
Fix case when the promo code has no expiry date set (should always be usable
then). Aka: fu introduces a bug -- thanks
exor674 for pointing
it out!
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3386
Fix case when the promo code has no expiry date set (should always be usable
then). Aka: fu introduces a bug -- thanks
it out!
Patch by
Files modified:
- cgi-bin/DW/InviteCodes/Promo.pm
--------------------------------------------------------------------------------
diff -r e60d765b5519 -r b3ab77b750fd cgi-bin/DW/InviteCodes/Promo.pm
--- a/cgi-bin/DW/InviteCodes/Promo.pm Fri Oct 28 19:41:12 2011 +0800
+++ b/cgi-bin/DW/InviteCodes/Promo.pm Sun Oct 30 22:57:26 2011 +0800
@@ -113,7 +113,7 @@
return 0 unless $self->{current_count} < $self->{max_count};
# 0 for expiry_date means never expire;
- return 0 unless $self->{expiry_date} && time() < $self->{expiry_date};
+ return 0 if $self->{expiry_date} && time() >= $self->{expiry_date};
return 1;
}
--------------------------------------------------------------------------------
