[1.8.x] Fixed #24469 -- Refined escaping of Django's form elements in non-Django templates.

Backport of 1f2abf784a from master
This commit is contained in:
Moritz Sichert 2015-03-18 21:42:59 +01:00 committed by Tim Graham
parent 6a2f46f238
commit 44a05a8a91
15 changed files with 197 additions and 21 deletions

View file

@ -6,9 +6,10 @@ from django.contrib.gis.geos import (
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import total_ordering
from django.utils.safestring import mark_safe
from django.utils.html import html_safe
@html_safe
@python_2_unicode_compatible
class GEvent(object):
"""
@ -56,9 +57,10 @@ class GEvent(object):
def __str__(self):
"Returns the parameter part of a GEvent."
return mark_safe('"%s", %s' % (self.event, self.action))
return '"%s", %s' % (self.event, self.action)
@html_safe
@python_2_unicode_compatible
class GOverlayBase(object):
def __init__(self):
@ -74,7 +76,7 @@ class GOverlayBase(object):
def __str__(self):
"The string representation is the JavaScript API call."
return mark_safe('%s(%s)' % (self.__class__.__name__, self.js_params))
return '%s(%s)' % (self.__class__.__name__, self.js_params)
class GPolygon(GOverlayBase):