cloudinary / cloudinary/cloudinary_gem
Spaces in Font's name are not escaped
- Dominant language
- Ruby
- Stars
- 420
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Description
Cloudinary supports all of Google's fonts https://support.cloudinary.com/hc/en-us/articles/203352832-What-is-the-list-of-supported-fonts-for-text-overlay-transformation- and some of them have spaces on them, for example, "Open Sans"
But unlike Text Transformation where spaces are escaped https://github.com/cloudinary/cloudinary_gem/blob/28a9ee65d24c6bac0654919a5a76de95cf356510/lib/cloudinary/utils.rb#L399 font family aren't https://github.com/cloudinary/cloudinary_gem/blob/28a9ee65d24c6bac0654919a5a76de95cf356510/lib/cloudinary/utils.rb#L452
resulting in an invalid URL
```ruby
[1] pry(main)> Cloudinary::VERSION
=> "1.20.0"
[2] pry(main)> url = Cloudinary::Utils.cloudinary_url("coffee_cup.jpg", transformation: [
{overlay: {font_family: "Open Sans", text: "Text with spaces", font_size: 10}}
])
=> "http://res.cloudinary.com/cookpad/image/upload/l_text:Open Sans_10:Text%20with%20spaces/coffee_cup.jpg"
[3] pry(main)> URI.parse url
URI::InvalidURIError: bad URI(is not URI?): "http://res.cloudinary.com/cookpad/image/upload/l_text:Open Sans_10:Text%20with%20spaces/coffee_cup.jpg"
```
Contributor guide
Assessment
This issue has not been assessed yet.