@@ -580,11 +606,11 @@
${tags.slice(0, 10).map(tag => `
- ${this.escapeHtml(tag)}
-
+ ${escapeHtml(tag)}
+
`).join("")}
-
-
+
▼
Show ${tags.length - 10} more tags
@@ -614,13 +640,13 @@
-
+
🖼️ Gallery
-
+
✏️ Edit
-
+
🗑️ Delete
@@ -676,12 +702,6 @@
});
}
- escapeHtml(text) {
- const div = document.createElement("div");
- div.textContent = text;
- return div.innerHTML;
- }
-
showNotification(message, type = "info") {
const notification = document.createElement("div");
@@ -765,7 +785,7 @@
const data = await response.json();
const dirs = data.settings?.monitored_directories || [];
if (dirs.length > 0) {
- statusEl.innerHTML = dirs.map(d => `
✓ ${d}
`).join('');
+ statusEl.innerHTML = dirs.map(d => `
✓ ${escapeHtml(d)}
`).join('');
} else {
statusEl.textContent = 'No directories being monitored (auto-detect on restart)';
}
@@ -1723,7 +1743,7 @@
html += `
- ${this.escapeHtml(category)}
+ ${escapeHtml(category)}
${status}
`;
@@ -1737,7 +1757,7 @@
(result.status === 'warning' ? 'bg-pm-warning/20 border-pm-warning' : 'bg-pm-error-tint border-pm-error');
html += `
`;
- html += `
${this.escapeHtml(category)}
`;
+ html += `
${escapeHtml(category)}
`;
if (result.message) {
html += `
${result.message}
`;
@@ -1780,7 +1800,7 @@
html += `
`;
for (const [dep, available] of Object.entries(result.dependencies)) {
const status = available ? '✅' : '❌';
- html += `
${status} ${dep}
`;
+ html += `
${status} ${escapeHtml(dep)}
`;
}
html += `
`;
}
@@ -2209,13 +2229,13 @@
container.innerHTML = data.files.map(file => `
- ${file.filename}
+ ${escapeHtml(file.filename)}
${file.is_main ? 'Active' : ''}
Size: ${this.formatBytes(file.size)} | Modified: ${new Date(file.modified).toLocaleString()}
-
📥 Download
@@ -2274,13 +2294,13 @@
return `
- ${timestamp.split(' ')[1]}
- ${log.level}
- ${log.logger}
- ${log.message}
+ ${escapeHtml(timestamp.split(' ')[1])}
+ ${escapeHtml(log.level)}
+ ${escapeHtml(log.logger)}
+ ${escapeHtml(log.message)}
- ${log.filename}:${log.lineno}
+ ${escapeHtml(log.filename)}:${escapeHtml(log.lineno)}
`;
@@ -2600,8 +2620,8 @@
File Path
-
- ${filePath}
+
+ ${escapeHtml(filePath)}
@@ -2610,7 +2630,7 @@
Resources used
-
${checkpoint}
+
${escapeHtml(checkpoint)}
ComfyUI Generated
CHECKPOINT
@@ -2629,7 +2649,7 @@
- ${positivePrompt.substring(0, 200)}${positivePrompt.length > 200 ? '...' : ''}
+ ${escapeHtml(positivePrompt.substring(0, 200))}${positivePrompt.length > 200 ? '...' : ''}
${positivePrompt.length > 200 ? '
Show more' : ''}
@@ -2645,7 +2665,7 @@
- ${negativePrompt.substring(0, 200)}${negativePrompt.length > 200 ? '...' : ''}
+ ${escapeHtml(negativePrompt.substring(0, 200))}${negativePrompt.length > 200 ? '...' : ''}
${negativePrompt.length > 200 ? '
Show more' : ''}
@@ -2654,12 +2674,12 @@
Other metadata
- CFG SCALE: ${cfgScale}
- STEPS: ${steps}
- SAMPLER: ${sampler}
+ CFG SCALE: ${escapeHtml(cfgScale)}
+ STEPS: ${escapeHtml(steps)}
+ SAMPLER: ${escapeHtml(sampler)}
- SEED: ${seed}
+ SEED: ${escapeHtml(seed)}
@@ -2783,7 +2803,7 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`;
if (!this.currentMetadata) return;
const prompt = type === 'positive' ? this.currentMetadata.positivePrompt : this.currentMetadata.negativePrompt;
- const safeType = this.escapeHtml(type.charAt(0).toUpperCase() + type.slice(1));
+ const safeType = escapeHtml(type.charAt(0).toUpperCase() + type.slice(1));
const newWindow = window.open('', '_blank');
const doc = newWindow.document;
doc.open();
@@ -3058,7 +3078,7 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`;
File Path
- ${metadata.imagePath}
+ ${escapeHtml(metadata.imagePath)}
@@ -3067,7 +3087,7 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`;
Resources used
-
${metadata.checkpoint}
+
${escapeHtml(metadata.checkpoint)}
ComfyUI Generated
CHECKPOINT
@@ -3086,7 +3106,7 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`;
- ${metadata.positivePrompt.substring(0, 200)}${metadata.positivePrompt.length > 200 ? '...' : ''}
+ ${escapeHtml(metadata.positivePrompt.substring(0, 200))}${metadata.positivePrompt.length > 200 ? '...' : ''}
${metadata.positivePrompt.length > 200 ? '
Show more' : ''}
@@ -3102,7 +3122,7 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`;