Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed SVG breaks gallery #346

Closed
LukasReschke opened this issue Sep 15, 2015 · 10 comments
Closed

Malformed SVG breaks gallery #346

LukasReschke opened this issue Sep 15, 2015 · 10 comments
Assignees
Milestone

Comments

@LukasReschke
Copy link
Member

A SVG file with invalid SVG breaks a whole gallery album.

Uncaught TypeError: Cannot set property 'alt' of null(anonymous function) @ galleryimage.js?v=58e6c41db6cb9e4292f27caf8b86a008:87(anonymous function) @ jquery.min.js?v=58e6c41db6cb9e4292f27caf8b86a008:4x.Callbacks.c @ jquery.min.js?v=58e6c41db6cb9e4292f27caf8b86a008:4x.Callbacks.p.fireWith @ jquery.min.js?v=58e6c41db6cb9e4292f27caf8b86a008:4x.extend.Deferred.x.each.i.(anonymous function) @ jquery.min.js?v=58e6c41db6cb9e4292f27caf8b86a008:4Thumbnails.loadBatch.eventSource.listen.thumb.image.onerror @ thumbnail.js?v=58e6c41db6cb9e4292f27caf8b86a008:135
@oparoz
Copy link
Contributor

oparoz commented Sep 15, 2015

Thanks :)

oparoz added a commit that referenced this issue Sep 17, 2015
Problems are usually detected on the PHP side, when trying to generate a preview, but it's not the case for SVG and there could be other problems along the road, so we fetch the media type icon in case of failure
Fixes #346
@oparoz
Copy link
Contributor

oparoz commented Sep 17, 2015

So it's actually a general problem. When an image fails to load, it will not be usable later on, so I'm now showing the media type icon, letting the user download the file

@oparoz oparoz added this to the 8.2-current milestone Sep 17, 2015
@oparoz oparoz self-assigned this Sep 17, 2015
oparoz added a commit that referenced this issue Sep 19, 2015
Problems are usually detected on the PHP side, when trying to generate a preview, but it's not the case for SVG and there could be other problems along the road, so we fetch the media type icon in case of failure
Fixes #346
oparoz added a commit that referenced this issue Sep 20, 2015
Problems are usually detected on the PHP side, when trying to generate a preview, but it's not the case for SVG and there could be other problems along the road, so we fetch the media type icon in case of failure
Fixes #346
oparoz added a commit that referenced this issue Sep 24, 2015
Problems are usually detected on the PHP side, when trying to generate a preview, but it's not the case for SVG and there could be other problems along the road, so we fetch the media type icon in case of failure
Fixes #346
@oparoz
Copy link
Contributor

oparoz commented Sep 27, 2015

A broken SVG you can use to test:
https://oc8demo.interfacloud.com/index.php/apps/galleryplus/s/q6j106oXEF5bi2q/53739.svg

You need to enable native_svg first in your gallery.cnf

@oparoz oparoz reopened this Sep 27, 2015
@oparoz
Copy link
Contributor

oparoz commented Sep 30, 2015

This requires #391 to work properly as SVGs containing an evil payload can still stop the rendering.

@ghost
Copy link

ghost commented Oct 1, 2015

@rperezb @SergioBertolinSG @davitol can you please test?

@rperezb
Copy link

rperezb commented Oct 2, 2015

@Dianafg76 will take care of this one, I am currently working with her, thx

@rperezb
Copy link

rperezb commented Oct 2, 2015

Checked, it doesn't break the gallery

File used: https://s3.owncloud.com/owncloud/index.php/s/MD4hOi7Fqv9o4WL
(The suggested one doesn't work)

Server version: ownCloud 8.2 beta1 (daily) Build:2015-10-02T03:39:51+00:00 f891b91cf8475eee16ab1ca08869430bd2dbe51b

@oparoz
Copy link
Contributor

oparoz commented Oct 3, 2015

(The suggested one doesn't work)

Can't download it? What kind of error are you getting?

@rperezb
Copy link

rperezb commented Oct 5, 2015

Ummm, on Friday it didn't work, I got a connection error..

Today I have downloaded it, and it works fine, meaning this, the gallery is not broken

@oparoz
Copy link
Contributor

oparoz commented Oct 5, 2015

Cool, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants