Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_.forEach(fields, (value, key) => {
settingsFile[key] = value;
if(key === 'customCss_input'){
settingsFile.customCss = escape.encode(uglifycss.processString(value));
}
if(key === 'footerHtml_input'){
const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
settingsFile.footerHtml = footerHtml;
}
if(key === 'googleAnalytics_input'){
const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
settingsFile.googleAnalytics = googleAnalytics;
}
});
parts.forEach((x, i) => {
let isLast = i >= (parts.length - 1);
currentDir += '/' + x;
addCrumbItem('/?p=' + encodeURIComponent(currentDir), Entities.encode(x),
isLast);
});
}
deploy_helpers.isBinaryContent(data).then((isBinary) => {
if (isBinary) {
html.write('@TODO: This is binary content!');
html.sendTo(resp);
}
else {
let str = data.toString('utf8');
let content = `
<div class="panel panel-default vsd-code-panel">
<div class="panel-heading">${Entities.encode(Path.basename(file))}</div>
<div class="panel-body">
<pre class="vsd-code-block"><code class="${ext}">${Entities.encode(str)}</code></pre>
</div>
</div>
`;
html.write(content);
dirList.forEach((x) => {
let dirName = Path.basename(x);
let ext = Path.extname(x);
if (ext) {
ext = ext.substr(1).toLowerCase().trim();
}
let cssClass = '';
if (ext) {
cssClass = `vsd-dir-${ext}`;
}
let dirPath = encodeURIComponent(dirRelativePath + '/' + dirName);
content += `<li class="list-group-item vsd-dir${cssClass}"><a href="/?p=${dirPath}">${Entities.encode(dirName)}</a></li>`;
});
fileList.forEach((x) => {
let fileName = Path.basename(x);
let ext = Path.extname(x);
if (ext) {
ext = ext.substr(1).toLowerCase().trim();
}
let cssClass = '';
if (ext) {
cssClass = `vsd-file-${ext}`;
}
let filePath = encodeURIComponent(dirRelativePath + '/' + fileName);
content += `<li class="list-group-item vsd-file${cssClass}"><a href="/?p=${filePath}">${Entities.encode(fileName)}</a></li>`;
});
deploy_helpers.isBinaryContent(data).then((isBinary) => {
if (isBinary) {
html.write('@TODO: This is binary content!');
html.sendTo(resp);
}
else {
let str = data.toString('utf8');
let content = `
<div class="panel panel-default vsd-code-panel">
<div class="panel-heading">${Entities.encode(Path.basename(file))}</div>
<div class="panel-body">
<pre class="vsd-code-block"><code class="${ext}">${Entities.encode(str)}</code></pre>
</div>
</div>
`;
_.forEach(fields, (value, key) => {
settingsFile[key] = value;
if(key === 'customCss_input'){
settingsFile.customCss = escape.encode(uglifycss.processString(value));
}
if(key === 'footerHtml_input'){
const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
settingsFile.footerHtml = footerHtml;
}
if(key === 'googleAnalytics_input'){
const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
settingsFile.googleAnalytics = googleAnalytics;
}
});
_.forEach(fields, (value, key) => {
settingsFile[key] = value;
if(key === 'customCss_input'){
settingsFile.customCss = escape.encode(uglifycss.processString(value));
}
if(key === 'footerHtml_input'){
const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
settingsFile.footerHtml = footerHtml;
}
if(key === 'googleAnalytics_input'){
const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
settingsFile.googleAnalytics = googleAnalytics;
}
});