Skip to content

Commit 1fa8bec

Browse files
Jay ParekhJay Parekh
authored andcommitted
fix URL encoding and slash replacement
1 parent 0da30c6 commit 1fa8bec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/imagekit/url.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ def transformation_to_str(transformation)
149149
transform_key = SUPPORTED_TRANS.fetch(key, nil)
150150
transform_key ||= key
151151

152+
if transform_key == "oi" || transform_key == "di"
153+
transformation[i][key][0] = "" if transformation[i][key][0] == "/"
154+
transformation[i][key] = transformation[i][key].gsub("/", "@@")
155+
end
156+
157+
transformation[i][key] = ERB::Util.url_encode(transformation[i][key]) if transform_key == "ot" || transform_key == "otf"
158+
152159
if transformation[i][key] == "-"
153160
parsed_transform_step.push(transform_key)
154161
else

0 commit comments

Comments
 (0)