#11347 Fix decode base 64 for japanese characters

This commit is contained in:
miguel angel rasteu 2023-06-12 16:18:28 +02:00
parent a70a6fc060
commit 2b2f9b983e
2 changed files with 12 additions and 4 deletions

View File

@ -1073,9 +1073,11 @@ if (!$new_user) {
'show_api_token',
false,
sprintf(
'javascript:showAPIToken("%s", "%s")',
'javascript:showAPIToken("%s", "%s", "%s", "%s")',
__('API Token'),
base64_encode(__('Your API Token is:').'&nbsp;<br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br>&nbsp;'.__('Please, avoid share this string with others.')),
__('Your API Token is:'),
base64_encode(users_get_API_token($id)),
__('Please, avoid share this string with others.'),
),
[
'mode' => 'link',

View File

@ -2230,10 +2230,16 @@ function renewAPIToken(title, message, form) {
* @param {string} title Title for show.
* @param {string} message Base64 encoded message for show.
*/
function showAPIToken(title, message) {
function showAPIToken(title, message_a, token, message_b) {
var message =
message_a +
'&nbsp;<br><span class="font_12pt bolder">' +
atob(token) +
"</span><br>&nbsp;" +
message_b;
confirmDialog({
title: title,
message: atob(message),
message: message,
hideCancelButton: true
});
}