From: Ian Jackson Date: Wed, 20 Mar 2013 18:29:21 +0000 (+0000) Subject: need_add_hidden: support use with the class rather than an object X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=80ac11c8ffdb77894c08209d677047cb4f6dbf53;p=cgi-auth-flexible.git need_add_hidden: support use with the class rather than an object --- diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 1f44b8d..1b51142 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -1303,8 +1303,10 @@ sub update_get_need_add_hidden ($$;$) { sub need_add_hidden ($$) { my ($r, $method, $reqtype) = @_; return 1 if $method ne 'GET'; - my $ent = $r->{GetNeedsSecretHidden}{$reqtype}; - return $ent if defined $ent; + if (ref $r) { + my $ent = $r->{GetNeedsSecretHidden}{$reqtype}; + return $ent if defined $ent; + } my $ent = $_resource_get_needs_secret_hidden{$reqtype}; return $ent if defined $ent; die "unsupported nonpage GET type $reqtype";