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 12:58:05 UTC

incubator-ponymail git commit: Bug: shorten links does not work with cluster ids

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 2801d8172 -> edc5d52ed


Bug: shorten links does not work with cluster ids

This fixes #406

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

Branch: refs/heads/master
Commit: edc5d52edb26af4be3b422aecc52da5b4502543c
Parents: 2801d81
Author: Sebb <se...@apache.org>
Authored: Fri Sep 8 13:57:58 2017 +0100
Committer: Sebb <se...@apache.org>
Committed: Fri Sep 8 13:57:58 2017 +0100

----------------------------------------------------------------------
 CHANGELOG.md                        | 1 +
 site/js/dev/ponymail_email_tools.js | 5 ++++-
 site/js/ponymail.js                 | 5 ++++-
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/edc5d52e/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12a624f..e9d7fc9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## CHANGES in 0.10:
+- Bug: shorten links does not work with cluster ids (#406)
 - Drop lid from 'cluster' hash - it's already in the id (#400)
 - Enh: 'cluster' generator ids are not sufficiently unique (#398)
 - archiver/importer adds a Message-Id to mails if they don't have one (#403)

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/edc5d52e/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 b8148f7..dba40a0 100644
--- a/site/js/dev/ponymail_email_tools.js
+++ b/site/js/dev/ponymail_email_tools.js
@@ -205,7 +205,10 @@ function formatEpochUTC(epoch){
 // hex -> base 36 conversion for creating shorter permalinks
 function shortenID(mid) {
     var id1 = parseInt(mid.substr(0,9), 16).toString(36)
-    
+    if (isNaN(id1)) { // conversion failed
+            return mid; // return unchanged
+    }
+
     // add padding if < 7 chars long
     while (id1.length < 7) id1 = '-' + id1
     var id2 = parseInt(mid.substr(9,9), 16).toString(36)

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/edc5d52e/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 9aa2310..f2a4a7d 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -2076,7 +2076,10 @@ function formatEpochUTC(epoch){
 // hex -> base 36 conversion for creating shorter permalinks
 function shortenID(mid) {
     var id1 = parseInt(mid.substr(0,9), 16).toString(36)
-    
+    if (isNaN(id1)) { // conversion failed
+            return mid; // return unchanged
+    }
+
     // add padding if < 7 chars long
     while (id1.length < 7) id1 = '-' + id1
     var id2 = parseInt(mid.substr(9,9), 16).toString(36)