Subject: | [PATCH] wrong return precedence |
returns binds stronger than and, so the expressions after and are ignored.
See https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802
Subject: | Auth-GoogleAuthenticator-0.01-returnand.patch |
diff -bu Auth-GoogleAuthenticator-0.01-1p_stP/lib/Auth/GoogleAuthenticator.pm~ Auth-GoogleAuthenticator-0.01-1p_stP/lib/Auth/GoogleAuthenticator.pm
--- Auth-GoogleAuthenticator-0.01-1p_stP/lib/Auth/GoogleAuthenticator.pm~ 2013-02-22 06:48:10.000000000 -0600
+++ Auth-GoogleAuthenticator-0.01-1p_stP/lib/Auth/GoogleAuthenticator.pm 2013-07-23 16:03:33.045126098 -0500
@@ -54,8 +54,8 @@
sub verify {
my ($self, $code, $ts) = @_;
- return $code and
- $self->totp( $ts ) == $code;
+ return $code &&
+ ($self->totp( $ts ) == $code);
}
1;