Skip to content

Unescaped URIs cause nothing to be displayed #113

Closed
jheeffer opened this Issue Apr 1, 2012 · 4 comments

2 participants

@jheeffer
jheeffer commented Apr 1, 2012

Hey Petr!

First off: Super plugin, really helpful!

I stumbled upon a bug: when using a sprite and there is a space (' ') in the path to the image, it completes loading but doesn't show the reel. Instead it shows a white screen. I'm on windows using chrome. The bug also exists in Firefox. Didn't test other browsers.

It seems this does not happen when a path to a sequence is given with the 'images' option.

I uploaded a test-case here:
http://jasperheeffer.nl/reel_test/

I guess the bug is in the fact that the background-image-url of the img-element is not in quotes.
I tried fixing it myself but my js-skills are not up to par with your code yet ; ). Hope it's an easy fix!

Thanks again for you work,
Jasper

@pisi pisi added a commit that referenced this issue Apr 2, 2012
@pisi Build tests to verify the behavior of #113 and set the functional cri…
…teria for the fix. One test for sprites, one for sequences.
a11969e
@pisi pisi added a commit that closed this issue Apr 2, 2012
@pisi Fixed #113 by adding a new private helper `reen()` for re-encoding ur…
…is called on each spot some URL is being dispatched.
cb54f43
@pisi pisi closed this in cb54f43 Apr 2, 2012
@pisi
Owner
pisi commented Apr 2, 2012

Good point, @jheeffer! Valuable feedback. Fixed that issue, please confirm with 1.1.4-devel. Thank you for improving Reel!

@pisi
Owner
pisi commented Apr 2, 2012

Here's a fiddle of it.

@pisi pisi was assigned Apr 2, 2012
@pisi pisi reopened this Apr 2, 2012
@jheeffer
jheeffer commented Apr 2, 2012

Hi Petr, it does work, but not perfectly

I forked your fiddle: http://jsfiddle.net/nfU9x/

I suppose your re-encode is not perfect.

@pisi
Owner
pisi commented Apr 2, 2012

The re-encode does all it can to fix an unsafe URI, but there are some ground rules and free-floating % is a bit too much, man ;)

2.4. Escape Sequences of RFC 2396:

Because the percent "%" character always has the reserved purpose of being the escape indicator, it must be escaped as "%25" in order to be used as data within a URI.

Your URL is not valid:

decodeURI("http://jasperheeffer.nl/reel_test/test%folder/sprite.jpg")
// throws "URI Error"

If the % is in the name of the folder, you need to use:

"http://jasperheeffer.nl/reel_test/test%25folder/sprite.jpg"

Updated fiddle - http://jsfiddle.net/nfU9x/1/

This aged but still valid stackoverflow answer nicely explains what can be used in the URL.

@pisi pisi closed this Apr 2, 2012
@pisi pisi added a commit that referenced this issue Jul 16, 2012
@pisi Reel 1.2
========

Lovely new features:
* in-picture annotations
* new image preloading method
* frame by frame stepping
* new data change model
* full documentation
* jQuery 1.5+

New options:
* `annotations`, `attr`, `cursor`, `steppable`, improved `images`

New events:
* `stepLeft`, `stepRight`, `openingDone`, improved `play`

New methods:
* `.unreel()`, improved `.reel()`

Includes fixes for issues #10, #20, #36, #51, #62, #64, #65, #69, #103, #110, #111, #113, #115, #117, #122, #124, #125, #126

Enjoy!
00c2a00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.