IkiWiki::Plugin::openid: as a precaution, do not call non-coderefs
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Wed, 15 Oct 2014 22:52:43 +0000 (23:52 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 16 Oct 2014 21:24:48 +0000 (22:24 +0100)
We're running under "use strict" here, so if CGI->param's array-context
misbehaviour passes an extra non-ref parameter, it shouldn't be executed
anyway... but it's as well to be safe.

[commit message added by smcv]

IkiWiki/Plugin/openid.pm

index 63112d9836342b3c29b04e046ac7f3fc5aeec48c..384af7e98965d520f58bd21ee87ccaceaa16ba48 100644 (file)
@@ -119,7 +119,9 @@ sub validate ($$$;$) {
        my $claimed_identity = $csr->claimed_identity($openid_url);
        if (! $claimed_identity) {
                if ($errhandler) {
-                       $errhandler->($csr->err);
+                       if (ref($errhandler) eq 'CODE') {
+                               $errhandler->($csr->err);
+                       }
                        return 0;
                }
                else {