From 7c7d6edbfd94e5b3e187778b89ac1febb5690cb9 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 19 Apr 2016 20:54:24 -0400 Subject: [PATCH] Swap validate_and_sanitize_basestring to use unicodify --- lib/galaxy/util/validation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/util/validation.py b/lib/galaxy/util/validation.py index 7b0686cec19..9bf4a8a5d84 100644 --- a/lib/galaxy/util/validation.py +++ b/lib/galaxy/util/validation.py @@ -3,6 +3,7 @@ TODO: Refactor BaseController references to similar methods to use this module. """ from galaxy import exceptions +from galaxy.util import unicodify from galaxy.util.sanitize_html import sanitize_html from six import string_types, text_type @@ -12,7 +13,7 @@ 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 unicodify( sanitize_html( val, 'utf-8', 'text/html' ), 'utf-8' ) def validate_and_sanitize_basestring_list( key, val ):