cloudinary / cloudinary/cloudinary_gem

Spaces in Font's name are not escaped

Offen
#458 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Ruby
Sterne
420
Forks
285
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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"
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start in lib/cloudinary/utils.rb, comparing the text transformation escaping around line 399 with the font-family handling around line 452. Reproduce the Open Sans example from the issue and verify that the generated Cloudinary URL escapes spaces in the font name and can be parsed as a valid URI.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ruby
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.