Foundation-sites: Equalizer breaking image querystring in 6.3

Created on 25 Jan 2017  路  8Comments  路  Source: foundation/foundation-sites

How to reproduce this bug:

  1. Run data-equalizer on a container with slow loading images in the watches
  2. The image within the resized child now gets a timestamp appended to the url. Hovever it ignores that there already is a querystring present and appends another questionmark instead of ampersand, IE the new url is path/to/image?width500?12345678 where 12345678 is the current timestamp

What should happen:

the timestamp should get appended after an ampersand if there is a querystring already present

What happened instead:

it appends another questionmark when the image has been loaded

Test case:

Codepen example: http://codepen.io/erikarenhill/pen/EZvJXx

This bug is not present in Foundation 6.2.4

Most helpful comment

Thanks @erikarenhill for the bug report and the codepen repro case. This is coming from https://github.com/zurb/foundation-sites/blob/develop/js/foundation.util.timerAndImageLoader.js#L70

Would you like to submit a PR to fix? if not I can tackle this.

All 8 comments

Thanks @erikarenhill for the bug report and the codepen repro case. This is coming from https://github.com/zurb/foundation-sites/blob/develop/js/foundation.util.timerAndImageLoader.js#L70

Would you like to submit a PR to fix? if not I can tackle this.

I can submit a PR tomorrow, thanks for pointing out the code @kball

@kball I created a PR: https://github.com/zurb/foundation-sites/pull/9706
Was going to create a visual test as well, but could not build with npm now for some reason. However the fix is very tiny and simple.

Fixed in #9706. Thanks @erikarenhill!

Hi,
Can this timestamp be disabled? It breaks pre-signed Amazon S3 image urls. As they fail validation because of the extra get parameter.

Hi @ffogarasi,
The mechanism for this was changed in https://github.com/zurb/foundation-sites/pull/9990, which is released in the 6.4 series (latest 6.4.1) and will be released in 6.3.2 once we get that patch release packaged up.

@kball It seems as if Amazon S3 image urls are still broken when using Equalizer, even with the most current changes. I'm using the latest Foundation rails gem. Unsure if this issue was resolved there as well.

Edit: At first glance, it looks like the change that was committed above, was potentially not done so for the rails gem.

https://github.com/zurb/foundation-rails/pull/251 fixes this for me. Thanks @jessedoyle

Was this page helpful?
0 / 5 - 0 ratings