Ticket #3826: trac3826-javascript-base64.patch
| File trac3826-javascript-base64.patch, 1.4 kB (added by cwitty, 5 months ago) |
|---|
-
a/sage/server/notebook/js.py
old new 3679 3679 var enc1, enc2, enc3, enc4; 3680 3680 var i = 0; 3681 3681 3682 do{3682 while (i < input.length) { 3683 3683 chr1 = input.charCodeAt(i++); 3684 3684 chr2 = input.charCodeAt(i++); 3685 3685 chr3 = input.charCodeAt(i++); … … 3697 3697 3698 3698 output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 3699 3699 keyStr.charAt(enc3) + keyStr.charAt(enc4); 3700 } while (i < input.length);3700 } 3701 3701 3702 3702 return output; 3703 3703 } … … 3718 3718 // remove all characters that are not A-Z, a-z, 0-9, +, /, or = 3719 3719 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 3720 3720 3721 do{3721 while (i < input.length) { 3722 3722 enc1 = keyStr.indexOf(input.charAt(i++)); 3723 3723 enc2 = keyStr.indexOf(input.charAt(i++)); 3724 3724 enc3 = keyStr.indexOf(input.charAt(i++)); … … 3736 3736 if (enc4 != 64) { 3737 3737 output = output + String.fromCharCode(chr3); 3738 3738 } 3739 } while (i < input.length);3739 } 3740 3740 3741 3741 return output; 3742 3742 }