mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 19:00:39 -07:00
Use Integer() instead of to_i
This commit is contained in:
@@ -43,7 +43,9 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def slice(input, offset, length=nil)
|
def slice(input, offset, length=nil)
|
||||||
input.to_s.slice(offset.to_i, (length || 1).to_i) || ''
|
offset = Integer(offset)
|
||||||
|
length = length ? Integer(length) : 1
|
||||||
|
input.to_s.slice(offset, length) || ''
|
||||||
end
|
end
|
||||||
|
|
||||||
# Truncate a string down to x characters
|
# Truncate a string down to x characters
|
||||||
|
|||||||
Reference in New Issue
Block a user