Skip to content

Commit 3538f97

Browse files
authored
Merge pull request #1951 from NginxProxyManager/test-html-encode
Fix #1950 attempt to encode hdomain values before render
2 parents eb148eb + feaafdc commit 3538f97

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

frontend/js/app/nginx/dead/delete.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form>
88
<div class="row">
99
<div class="col-sm-12 col-md-12">
10-
<%= i18n('dead-hosts', 'delete-confirm', {domains: domain_names.join(', ')}) %>
10+
<%= i18n('dead-hosts', 'delete-confirm', {domains: domain_names.join(', ').toHtmlEntities()}) %>
1111
<% if (certificate_id) { %>
1212
<br><br>
1313
<%- i18n('ssl', 'delete-ssl') %>

frontend/js/app/nginx/proxy/delete.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form>
88
<div class="row">
99
<div class="col-sm-12 col-md-12">
10-
<%= i18n('proxy-hosts', 'delete-confirm', {domains: domain_names.join(', ')}) %>
10+
<%= i18n('proxy-hosts', 'delete-confirm', {domains: domain_names.join(', ').toHtmlEntities()}) %>
1111
<% if (certificate_id) { %>
1212
<br><br>
1313
<%- i18n('ssl', 'delete-ssl') %>

frontend/js/app/nginx/redirection/delete.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form>
88
<div class="row">
99
<div class="col-sm-12 col-md-12">
10-
<%= i18n('redirection-hosts', 'delete-confirm', {domains: domain_names.join(', ')}) %>
10+
<%= i18n('redirection-hosts', 'delete-confirm', {domains: domain_names.join(', ').toHtmlEntities()}) %>
1111
<% if (certificate_id) { %>
1212
<br><br>
1313
<%- i18n('ssl', 'delete-ssl') %>

frontend/js/app/user/delete.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form>
88
<div class="row">
99
<div class="col-sm-12 col-md-12">
10-
<%= i18n('users', 'delete-confirm', {name: name}) %>
10+
<%= i18n('users', 'delete-confirm', {name: name.toHtmlEntities()}) %>
1111
</div>
1212
</div>
1313
</form>

frontend/js/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ window.tabler = {
103103
}
104104
};
105105

106+
String.prototype.toHtmlEntities = function() {
107+
return this.replace(/./gm, function(s) {
108+
// return "&#" + s.charCodeAt(0) + ";";
109+
return (s.match(/[a-z0-9\s]+/i)) ? s : "&#" + s.charCodeAt(0) + ";";
110+
});
111+
};
112+
106113
require('tabler-core');
107114

108115
const App = require('./app/main');

frontend/webpack.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ module.exports = {
9292
]
9393
},
9494
{
95-
test: /source-sans-pro.*\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
96-
use: [
97-
{
98-
loader: 'file-loader',
99-
options: {
100-
name: '[name].[ext]',
101-
outputPath: 'assets/'
102-
}
103-
}
104-
]
105-
}
95+
test: /source-sans-pro.*\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/,
96+
use: [
97+
{
98+
loader: 'file-loader',
99+
options: {
100+
name: '[name].[ext]',
101+
outputPath: 'assets/'
102+
}
103+
}
104+
]
105+
}
106106
]
107107
},
108108
plugins: [

0 commit comments

Comments
 (0)