From: Ian Jackson Date: Tue, 27 Oct 2015 18:49:04 +0000 (+0000) Subject: blinding: Fix (again) move of Params setting into check_divert X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=cgi-auth-flexible.git;a=commitdiff_plain;h=d8f2e2818a90ea2fa2ce60985f613875b5e52f7c;ds=sidebyside blinding: Fix (again) move of Params setting into check_divert Do not inadvertently autoviviy $divert as an arrayref. If we do then the web app (or check_ok) sees it as trueish and will try diverting with an empty divert spec, rather than seeing it as falseish and correctly proceeding to do the real work. Signed-off-by: Ian Jackson --- diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 79e12d3..a297519 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -1030,9 +1030,9 @@ sub check_divert ($) { $dbh->commit(); my $divert = $r->{Divert}; - my $cookraw = $divert->{_CookieRaw}; - $divert->{CookieSecret} = $r->_blind($cookraw); + my $cookraw = $divert && $divert->{_CookieRaw}; if ($cookraw) { + $divert->{CookieSecret} = $r->_blind($cookraw); $divert->{Params}{$r->{S}{assoc_param_name}} = [ $r->_blind($r->hash($cookraw)) ];