You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2017/09/08 15:40:42 UTC

incubator-ponymail git commit: Bug: shorten links does not work with cluster ids (#406)

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master edc5d52ed -> 4fc4cbc40


Bug: shorten links does not work with cluster ids (#406)

Also check second conversion has worked


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/4fc4cbc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/4fc4cbc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/4fc4cbc4

Branch: refs/heads/master
Commit: 4fc4cbc40a7c21bac7cc4d6f41d68927a6d62efd
Parents: edc5d52
Author: Sebb <se...@apache.org>
Authored: Fri Sep 8 16:39:22 2017 +0100
Committer: Sebb <se...@apache.org>
Committed: Fri Sep 8 16:39:22 2017 +0100

----------------------------------------------------------------------
 site/js/dev/ponymail_email_tools.js | 4 ++++
 site/js/ponymail.js                 | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4fc4cbc4/site/js/dev/ponymail_email_tools.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_email_tools.js b/site/js/dev/ponymail_email_tools.js
index dba40a0..6b52392 100644
--- a/site/js/dev/ponymail_email_tools.js
+++ b/site/js/dev/ponymail_email_tools.js
@@ -211,7 +211,11 @@ function shortenID(mid) {
 
     // add padding if < 7 chars long
     while (id1.length < 7) id1 = '-' + id1
+
     var id2 = parseInt(mid.substr(9,9), 16).toString(36)
+    if (isNaN(id2)) { // conversion failed
+            return mid; // return unchanged
+    }
     while (id2.length < 7) id2 = '-' + id2
     
     // add 'Z' which is the short link denoter

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4fc4cbc4/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index f2a4a7d..d3c83cf 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -2082,7 +2082,11 @@ function shortenID(mid) {
 
     // add padding if < 7 chars long
     while (id1.length < 7) id1 = '-' + id1
+
     var id2 = parseInt(mid.substr(9,9), 16).toString(36)
+    if (isNaN(id2)) { // conversion failed
+            return mid; // return unchanged
+    }
     while (id2.length < 7) id2 = '-' + id2
     
     // add 'Z' which is the short link denoter