mirror of
https://github.com/lwch/natpass.git
synced 2024-04-21 12:41:54 +00:00
@@ -48,7 +48,7 @@ var page = {
|
||||
</div>`;
|
||||
var obj = $(str);
|
||||
obj.attr('id', 'tab-'+idx);
|
||||
obj.find('iframe').attr('src', 'http://'+location.hostname+':'+$('#terms').val());
|
||||
obj.find('iframe').attr('src', 'http://'+location.hostname+':'+escape($('#terms').val()));
|
||||
$('#tab-content').append(obj);
|
||||
page.idx++;
|
||||
},
|
||||
|
||||
@@ -2,6 +2,13 @@ function arg(key) {
|
||||
var url = new URL(location.href);
|
||||
return decodeURIComponent(url.searchParams.get(key));
|
||||
}
|
||||
function escape(htmlStr) {
|
||||
return htmlStr.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
var humanize = {
|
||||
bytes: function(n) {
|
||||
return humanize.humanate_bytes(n, 1024, ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'])
|
||||
|
||||
Reference in New Issue
Block a user