Skip to content

Commit

Permalink
Merge 28c7445 into c0a6279
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Dec 30, 2018
2 parents c0a6279 + 28c7445 commit c9d7d5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions masonite/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ def clean_request_input(value):
return value
elif isinstance(value, dict):
return {key: html.escape(val) for (key, val) in value.items()}

return value
2 changes: 1 addition & 1 deletion masonite/info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Module for specifying the Masonite version in a central location."""

VERSION = '2.1.3'
VERSION = '2.1.4'
9 changes: 9 additions & 0 deletions tests/helpers/test_clean_request_input.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from masonite.helpers import clean_request_input
import cgi

class TestCleanRequestInput:

Expand All @@ -17,3 +18,11 @@ def test_can_clean_dictionary(self):
assert clean_request_input(
{'key': '<img """><script>alert(\'hey\')</script>">'}
) == {'key': '&lt;img &quot;&quot;&quot;&gt;&lt;script&gt;alert(&#x27;hey&#x27;)&lt;/script&gt;&quot;&gt;'}

def test_does_not_clean_field_storage_objects(self):
fieldstorage = FieldStorageTest()
assert clean_request_input(fieldstorage) == fieldstorage


class FieldStorageTest(cgi.FieldStorage):
pass

0 comments on commit c9d7d5e

Please sign in to comment.