Fixed #8041 -- Modified media rendering to return safe strings. Thanks to Daniel Pope <dan@mauveinternet.co.uk> for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8285 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2008-08-10 12:29:47 +00:00
parent 2e08591403
commit 4ecc5f490a
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class Media(StrAndUnicode):
return self.render() return self.render()
def render(self): def render(self):
return u'\n'.join(chain(*[getattr(self, 'render_' + name)() for name in MEDIA_TYPES])) return mark_safe(u'\n'.join(chain(*[getattr(self, 'render_' + name)() for name in MEDIA_TYPES])))
def render_js(self): def render_js(self):
return [u'<script type="text/javascript" src="%s"></script>' % self.absolute_path(path) for path in self._js] return [u'<script type="text/javascript" src="%s"></script>' % self.absolute_path(path) for path in self._js]