diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 21:51:48 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-05-19 21:51:48 -0700 |
commit | 507dfb9f85bd0376901750f76f5978df3738f3e2 (patch) | |
tree | 32019a691dc01a70e6c965a06ca75432b80e5787 /include/text.php | |
parent | acc8e10a450f8427f523261f0f6e9d683cfe0e38 (diff) | |
download | volse-hubzilla-507dfb9f85bd0376901750f76f5978df3738f3e2.tar.gz volse-hubzilla-507dfb9f85bd0376901750f76f5978df3738f3e2.tar.bz2 volse-hubzilla-507dfb9f85bd0376901750f76f5978df3738f3e2.zip |
add rot47 to the mix. This shouldn't affect the speed to any measurable degree.
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 10 |
1 files changed, 8 insertions, 2 deletions
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'); +} |