2026-07-12 20:22:15 +01:00

38 lines
926 B
Python
Executable File

from flask import (
Flask,
render_template,
request,
render_template_string
)
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
output = ""
blacklist = ["config", "self", "_", '"',
"[", "]", " ", "join", "%", "%25"]
if request.method == 'POST':
search_term = request.form.get('search_term', '')
output = 'Backup "<strong>' + search_term + '</strong>" is not available due to technical issues.'
for x in blacklist:
if x in search_term:
output = 'Are you doing something naughty on this backup server?'
break
return render_template('index.html',
search_result=render_template_string(output))
@app.route('/about')
def about():
return render_template('about.html')
@app.route('/contact')
def contact():
return render_template('contact.html')