From 507dfb9f85bd0376901750f76f5978df3738f3e2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 19 May 2015 21:51:48 -0700 Subject: add rot47 to the mix. This shouldn't affect the speed to any measurable degree. --- include/text.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 5b9b35c16..f2d9f3e69 100644 --- a/include/text.php +++ b/include/text.php @@ -1199,9 +1199,9 @@ function unobscure(&$item) { function unobscure_mail(&$item) { if(array_key_exists('mail_flags',$item) && ($item['mail_flags'] & MAIL_OBSCURED)) { if($item['title']) - $item['title'] = base64url_decode($item['title']); + $item['title'] = base64url_decode(str_rot47($item['title'])); if($item['body']) - $item['body'] = base64url_decode($item['body']); + $item['body'] = base64url_decode(str_rot47($item['body'])); } } @@ -2557,3 +2557,9 @@ function userReadableSize($size) { return $ret; } + +function str_rot47($str) { + return strtr($str, + '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~', + 'PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO'); +} -- cgit v1.2.3