Skip to content

Commit cc456f2

Browse files
author
Vlad Ya
committed
Proper fix for the prefix corruption (for user names with non-alphanumeric characters)
and keep the prevention of addition of ftp user names with non-alphanumeric characters as it was intended initially
1 parent a32b604 commit cc456f2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

web/js/pages/add.web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
33
$(elm).parent().find('.hint').html('');
44
}
55

6-
//hint = hint.replace(/[^\w\d]/gi, '');
7-
86
if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) {
97
hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length);
108
}
9+
hint = hint.replace(/[^\w\d]/gi, '');
10+
1111
$(elm).parent().find('.v-ftp-user').val(hint);
1212
$(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint);
1313
}

web/js/pages/edit.web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
33
$(elm).parent().find('.hint').html('');
44
}
55

6-
//hint = hint.replace(/[^\w\d]/gi, '');
7-
86
if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) {
97
hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length);
108
}
9+
hint = hint.replace(/[^\w\d]/gi, '');
10+
1111
$(elm).parent().find('.v-ftp-user').val(hint);
1212
$(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint);
1313
}

0 commit comments

Comments
 (0)