From 364c334b98f75a1921e58c5776773cbc34d8be0d Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 16 Dec 2014 20:26:01 +0000 Subject: [PATCH] Absolute URL for emoticons --- rophako/model/emoticons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rophako/model/emoticons.py b/rophako/model/emoticons.py index 07d121a..019f37f 100644 --- a/rophako/model/emoticons.py +++ b/rophako/model/emoticons.py @@ -2,6 +2,7 @@ """Emoticon models.""" +from flask import request import os import codecs import json @@ -69,7 +70,7 @@ def render(message): if trigger in message: # Substitute it. sub = """{trigger}""".format( - url="/static/smileys/{}/{}".format(Config.emoticons.theme, img), + url="{}/static/smileys/{}/{}".format(request.url_root.strip("/"), Config.emoticons.theme, img), trigger=trigger, ) pattern = r'([^A-Za-z0-9:\-]|^){}([^A-Za-z0-9:\-]|$)'.format(re.escape(trigger))