On 8 September 2016 at 07:08, <[email protected]> wrote: > Repository: incubator-ponymail > Updated Branches: > refs/heads/coffee-and-cake ae791c1a6 -> 20031f532 > > > padding > > > Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo > Commit: > http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/5baa9534 > Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/5baa9534 > Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/5baa9534 > > Branch: refs/heads/coffee-and-cake > Commit: 5baa9534da5a055adb7d311bd4a29205eb7f00de > Parents: ae791c1 > Author: Daniel Gruno <[email protected]> > Authored: Thu Sep 8 08:07:35 2016 +0200 > Committer: Daniel Gruno <[email protected]> > Committed: Thu Sep 8 08:07:35 2016 +0200 > > ---------------------------------------------------------------------- > site/js/coffee/misc.coffee | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/5baa9534/site/js/coffee/misc.coffee > ---------------------------------------------------------------------- > diff --git a/site/js/coffee/misc.coffee b/site/js/coffee/misc.coffee > index 2ac684c..8d94389 100644 > --- a/site/js/coffee/misc.coffee > +++ b/site/js/coffee/misc.coffee > @@ -105,7 +105,7 @@ shortenURL = (mid) -> > num = parseInt(a, 16) > res = num.toString(36) > while res.length < 7 > - res = '0' + res > + res = '-' + res > out += res > return "PZ" + out > > @@ -115,7 +115,7 @@ unshortenURL = (mid) -> > if mid.substr(0,2) == 'PZ' > out = "" > for i in [0..shortBits-1] > - num = parseInt(mid.substr(2+(i*7), 7), 36) > + num = parseInt(mid.substr(2+(i*7), 7).replace('-', ''), 36)
That invocation of replace only fixes the first '-' in an encoded chunk. The result is corruption of any mids which have leading zeros in a chunk > res = num.toString(16) > while res.length < 8 > res = '0' + res >
