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

Fix viewing PDF files with public share links #309

Closed
wants to merge 1 commit into from

Conversation

wankdanker
Copy link

In #286, users have reported that PDF files
are not viewable via public share links. The issue was introduced in
c992b55 when attempting to encode parts of the URL for files that
have special characters.

This patch uses the URL Web API to deal with the parts of the URL
in a more specific way. Also, the path and files searchParams are
set based on this.filename and this.basename in the same way
it is done in the View module when setting davPath.

This has been tested on private and shared public links on files
with and without special characters.

In nextcloud#286, users have reported that PDF files
are not viewable via public share links. The issue was introduced in
c992b55 when attempting to encode parts of the URL for files that
have special characters.

This patch uses the URL Web API to deal with the parts of the URL
in a more specific way. Also, the path and files searchParams are
set based on `this.filename` and `this.basename` in the same way
it is done in the View module when setting `davPath`.

This has been tested on private and shared public links on files
with and without special characters.
@violoncelloCH
Copy link
Member

I just applied this patch on my production instance (cherry-picked onto stable20) as I've the same issue as in #305 (also related: #286 and #207)
it looks good and works so far...

@filou77
Copy link

filou77 commented Feb 13, 2021

We also applied this patch (onto v20.0.7).
It does also fix things for us.
Thanks.

@Davka
Copy link

Davka commented Feb 15, 2021

we have also patched our installation and it works.

@juliushaertl
Copy link
Member

Unfortnately this seems the bring back the original issue as then the dav path sections would no longer be escaped properly. I'll have a look into that.

@sseide
Copy link

sseide commented Jun 10, 2021

Have the same problem that i cannot open PDF files while PDF viewer app is enabled. Accessing via WEBDAV works fine.
Therefore encoding is wrong and not fixed by now in current version.

Nextcloud 20.0.10 / PDF viewer 2.0.1 seems to double encode the url, e.g every path component like
blah blub gets encoded to blah%2520blub instead of blah%20blub

created new ticket here #421

best regards,
S.Seide

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

Successfully merging this pull request may close these issues.

None yet

7 participants