diff --git a/sites/website.py b/sites/website.py index aeebead..da38f34 100644 --- a/sites/website.py +++ b/sites/website.py @@ -13,11 +13,18 @@ def render(data,db_object): # Render as HTML html = "" + ssl = "" + if ("localhost" in request.host or "127.0.0.1" in request.host): + ssl = "" + try: soup = BeautifulSoup(data, 'html.parser') for script in soup.find_all('script'): script.extract() + # Inject SSL + soup.append(BeautifulSoup(ssl, 'html.parser')) + html = str(soup) except Exception as e: return "

Invalid HTML


" + str(e) @@ -66,8 +73,9 @@ def render(data,db_object): except Exception as e: return "

Invalid data


Please contact support


This can often be fixed by saving your site again in the editor


" + "" - - return render_template('city.html',html=html,bg_colour=bg_colour,text_colour=text_colour, + + + return render_template('city.html',bg_colour=bg_colour,text_colour=text_colour, fg_colour=fg_colour, avatar=avatar,main_domain=main_domain, hnschat=hnschat,email=email,location=location, hns_icon=hns_icon, hns=hns,btc=btc,eth=eth, data=html)