Skip to content

Commit b78edae

Browse files
committed
added escaping meta tag content values
1 parent 747d8c4 commit b78edae

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

quintagroup/seoptimizer/browser/viewlets.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,13 @@ def listMetaTags(self):
9292
# Special cases
9393
if accessor == 'Description' and \
9494
not 'description' in metadata_names:
95-
result['description'] = value
95+
result['description'] = escape(value)
9696
elif accessor == 'Subject' and \
9797
not 'keywords' in metadata_names:
98-
result['keywords'] = value
98+
result['keywords'] = escape(value)
9999

100100
if accessor not in ('Description', 'Subject'):
101-
if accessor == 'seo_description':
102-
result[key] = escape(value)
103-
else:
104-
result[key] = value
101+
result[key] = escape(value)
105102

106103
if use_all:
107104
created = self.context.CreationDate()
@@ -146,7 +143,7 @@ def listMetaTags(self):
146143
seo_context['seo_customMetaTags'] or []
147144
for tag in custom_meta_tags:
148145
if tag['meta_content']:
149-
result[tag['meta_name']] = tag['meta_content']
146+
result[tag['meta_name']] = escape(tag['meta_content'])
150147

151148
return result
152149

0 commit comments

Comments
 (0)