mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-17 18:00:41 -07:00
convert template source to string to ensure encoding validity
This commit is contained in:
@@ -107,8 +107,9 @@ module Liquid
|
||||
# Returns self for easy chaining
|
||||
def parse(source, options = {})
|
||||
parse_context = configure_options(options)
|
||||
source = source.to_s.to_str
|
||||
|
||||
if source.is_a?(String) && !source.valid_encoding?
|
||||
unless source.valid_encoding?
|
||||
raise SyntaxError, parse_context.locale.t("errors.syntax.invalid_template_encoding")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user