mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
fix: broken html, escape
This commit is contained in:
+5
-9
@@ -1,4 +1,4 @@
|
|||||||
from flask import Blueprint, current_app, flash, request, redirect, url_for, render_template, send_file, make_response, session
|
from flask import Blueprint, current_app, flash, request, redirect, url_for, render_template, send_file, make_response, session, escape
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
@@ -53,18 +53,14 @@ def project():
|
|||||||
# skip it
|
# skip it
|
||||||
continue
|
continue
|
||||||
if '.ascii' in file:
|
if '.ascii' in file:
|
||||||
#data = data.replace(" ", " ")
|
|
||||||
data = conv.convert(data, full=False)
|
data = conv.convert(data, full=False)
|
||||||
#data = data.replace("\n", "<br>")
|
|
||||||
if '.hex' in file:
|
if '.hex' in file:
|
||||||
|
data = escape(data)
|
||||||
#data = highlight(data, HexdumpLexer(), HtmlFormatter(full=False))
|
#data = highlight(data, HexdumpLexer(), HtmlFormatter(full=False))
|
||||||
#data = data.replace("\n", "<br>")
|
|
||||||
#data = data.replace(" ", " ")
|
|
||||||
data = data.replace("<", "<")
|
|
||||||
data = data.replace(">", ">")
|
|
||||||
elif '.log' in file:
|
elif '.log' in file:
|
||||||
data = data.replace("<", "<")
|
data = escape(data)
|
||||||
data = data.replace(">", ">")
|
else:
|
||||||
|
data = escape(data)
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
"name": file,
|
"name": file,
|
||||||
|
|||||||
Reference in New Issue
Block a user