You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/03/22 12:48:23 UTC

[whimsy] branch master updated: Flag short PGP keys

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 9f261bd  Flag short PGP keys
9f261bd is described below

commit 9f261bd03b0950c66c994c2c75277de72e3e84d3
Author: Sebb <se...@apache.org>
AuthorDate: Fri Mar 22 12:48:19 2019 +0000

    Flag short PGP keys
---
 www/roster/views/person/pgpkeys.js.rb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/www/roster/views/person/pgpkeys.js.rb b/www/roster/views/person/pgpkeys.js.rb
index b1ba5fa..ca2ea7b 100644
--- a/www/roster/views/person/pgpkeys.js.rb
+++ b/www/roster/views/person/pgpkeys.js.rb
@@ -13,12 +13,19 @@ class PersonPgpKeys < Vue
         _ul committer.pgp do |key|
           _li do
             if key =~ /^[0-9a-fA-F ]+$/
+              k = key.gsub(' ', '')
               _samp do
                 _a key, target: '_blank', href: 'https://sks-keyservers.net/pks/lookup?' +
-                  'op=index&fingerprint=on&hash=on&search=0x' + key.gsub(' ', '')
+                  'op=index&fingerprint=on&hash=on&search=0x' + k
+                unless k.length == 40
+                  _span.bg_danger ' ?? Expecting exactly 40 hex characters (plus optional spaces)'
+                end
               end
             else
-              _samp key
+              _samp do
+                _ key
+                _span.bg_danger ' ?? Expecting exactly 40 hex characters (plus optional spaces)'
+              end
             end
           end
         end