mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Merge pull request #173 from jsw0528/master
fix `can't convert Fixnum into String` for `replace`
This commit is contained in:
@@ -102,12 +102,12 @@ module Liquid
|
||||
|
||||
# Replace occurrences of a string with another
|
||||
def replace(input, string, replacement = '')
|
||||
input.to_s.gsub(string, replacement)
|
||||
input.to_s.gsub(string, replacement.to_s)
|
||||
end
|
||||
|
||||
# Replace the first occurrences of a string with another
|
||||
def replace_first(input, string, replacement = '')
|
||||
input.to_s.sub(string, replacement)
|
||||
input.to_s.sub(string, replacement.to_s)
|
||||
end
|
||||
|
||||
# remove a substring
|
||||
|
||||
Reference in New Issue
Block a user