Skip to content

IMGKit.new fails on url' with ampersand #74

@pacMakaveli

Description

@pacMakaveli

Hello,

So this is a weird one and one that gave me a couple of headaches.
Why is IMGKit failing when given url's contain ampersands(&) ?

I know I can 'sanitize' the URL to remove the ampersand. However, I don't want to do it, really.

Here's the log.

Failed example:

irb(main):115:0> Bookmark.find(2).test
  Bookmark Load (0.5ms)  SELECT  `bookmarks`.* FROM `bookmarks` WHERE `bookmarks`.`id` = 2 LIMIT 1
"http://www.sitepoint.com/recreating-google-images-search-layout-css/?utm_source=html5weekly&utm_medium=email"
=> #<File:tmp/screens/bookmarks/capture_220150214-4859-zx7b06.png (closed)>
irb(main):116:0>

Working example:

irb(main):117:0> Bookmark.find(2).test
  Bookmark Load (0.4ms)  SELECT  `bookmarks`.* FROM `bookmarks` WHERE `bookmarks`.`id` = 2 LIMIT 1
"http://www.sitepoint.com/recreating-google-images-search-layout-css/"
=> #<File:tmp/screens/bookmarks/capture_220150214-4859-sj0p2h.png (closed)>
irb(main):118:0>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions