aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/formatting.py10
-rw-r--r--cgi/post.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/cgi/formatting.py b/cgi/formatting.py
index 6b2d8bc..373d685 100644
--- a/cgi/formatting.py
+++ b/cgi/formatting.py
@@ -43,8 +43,8 @@ def format_post(message, ip, parentid, parent_timestamp=0):
if Settings.VIDEO_THUMBS:
(message, affected) = videoThumbs(message)
- if affected:
- message = close_html(message)
+ #if affected:
+ # message = close_html(message)
message = clickableURLs(message)
message = checkRefLinks(message, parentid, parent_timestamp)
@@ -299,7 +299,11 @@ def close_html(message):
Old retarded version of sanitize_html, it just closes open tags.
"""
import BeautifulSoup
- return unicode(BeautifulSoup.BeautifulSoup(message)).replace('
', '').encode('utf-8')
+
+ message = message.encode('utf-8')
+ soup = BeautifulSoup.BeautifulSoup(message)
+
+ return unicode(soup).replace('
', '').encode('utf-8')
def sanitize_html(message, decode=True):
"""
diff --git a/cgi/post.py b/cgi/post.py
index 9d6f9c2..8937054 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -179,7 +179,7 @@ def shortenMsg(message, elid='0', elboard='0'):
if len(message_shortened) > limit:
message_shortened = message_shortened[:limit]
- message_shortened = formatting.close_html(message_shortened)
+ #message_shortened = formatting.close_html(message_shortened)
return True, message_shortened
else: