fix: Only remove scripts
This commit is contained in:
parent
5ab71b84e0
commit
43ac7cfc6d
@ -9,5 +9,4 @@ py3dns
|
|||||||
passlib
|
passlib
|
||||||
argon2-cffi
|
argon2-cffi
|
||||||
mysql-connector-python
|
mysql-connector-python
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
bleach
|
|
@ -1,6 +1,5 @@
|
|||||||
from flask import Flask, make_response, redirect, render_template_string, request, jsonify, render_template, send_from_directory
|
from flask import Flask, make_response, redirect, render_template_string, request, jsonify, render_template, send_from_directory
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import bleach
|
|
||||||
|
|
||||||
def render(data):
|
def render(data):
|
||||||
if data == "":
|
if data == "":
|
||||||
@ -12,7 +11,7 @@ def render(data):
|
|||||||
script.extract()
|
script.extract()
|
||||||
|
|
||||||
modified = str(soup)
|
modified = str(soup)
|
||||||
return render_template_string(bleach.clean(modified))
|
return render_template_string(modified)
|
||||||
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user