Commit d4b80025 by Dave St.Germain Committed by Sarina Canelake

Fixes MAT-4

parent 843225ca
......@@ -18,7 +18,7 @@ try:
except ImportError:
def force_unicode(x):
return(x)
from django.utils.html import escape, conditional_escape
from django.utils.html import escape, conditional_escape, strip_tags
from django.core.urlresolvers import resolve, Resolver404
from itertools import chain
......@@ -153,6 +153,10 @@ class EditForm(forms.Form, SpamProtectionMixin):
super(EditForm, self).__init__(*args, **kwargs)
def clean_title(self):
title = strip_tags(self.cleaned_data['title'])
return title
def clean(self):
cd = self.cleaned_data
if self.no_clean or self.preview:
......@@ -255,6 +259,10 @@ class CreateForm(forms.Form, SpamProtectionMixin):
summary = forms.CharField(label=_('Summary'), help_text=_("Write a brief message for the article's history log."),
required=False)
def clean_title(self):
title = strip_tags(self.cleaned_data['title'])
return title
def clean_slug(self):
slug = self.cleaned_data['slug']
if slug.startswith("_"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment