Skip to content

Commit

Permalink
Merge pull request #2197 from dannon/pages_parser_fix
Browse files Browse the repository at this point in the history
[16.04] Pages parser fix
  • Loading branch information
nsoranzo committed Apr 20, 2016
2 parents adbc668 + 0cde386 commit 8749c82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/util/sanitize_html.py
Expand Up @@ -194,7 +194,7 @@ def convert_entityref(self, name):

def output(self):
'''Return processed HTML as a single string'''
return ''.join([str(p) for p in self.pieces])
return ''.join(self.pieces)


class _HTMLSanitizer(_BaseHTMLProcessor):
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/util/validation.py
Expand Up @@ -5,20 +5,20 @@
from galaxy import exceptions
from galaxy.util.sanitize_html import sanitize_html

from six import string_types, text_type
from six import string_types


def validate_and_sanitize_basestring( key, val ):
if not isinstance( val, string_types ):
raise exceptions.RequestParameterInvalidException( '%s must be a string or unicode: %s'
% ( key, str( type( val ) ) ) )
return text_type( sanitize_html( val, 'utf-8', 'text/html' ), 'utf-8' )
return sanitize_html( val, 'utf-8', 'text/html' )


def validate_and_sanitize_basestring_list( key, val ):
try:
assert isinstance( val, list )
return [ text_type( sanitize_html( t, 'utf-8', 'text/html' ), 'utf-8' ) for t in val ]
return [ sanitize_html( t, 'utf-8', 'text/html' ) for t in val ]
except ( AssertionError, TypeError ):
raise exceptions.RequestParameterInvalidException( '%s must be a list of strings: %s'
% ( key, str( type( val ) ) ) )
Expand Down

0 comments on commit 8749c82

Please sign in to comment.