add rot47 to the mix. This shouldn't affect the speed to any measurable degree.

This commit is contained in:
redmatrix
2015-05-19 21:51:48 -07:00
parent acc8e10a45
commit 507dfb9f85
4 changed files with 26 additions and 20 deletions

View File

@@ -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');
}