Navigation Menu

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

Email report export a php file not a pdf one #19049

Open
Chardonneaur opened this issue Apr 5, 2022 · 11 comments
Open

Email report export a php file not a pdf one #19049

Chardonneaur opened this issue Apr 5, 2022 · 11 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@Chardonneaur
Copy link

Hello,
when using Microsoft Windows, either on Google Chrome or Firefox, when exporting a pdf it is in fact exporting a php file. This issue is not happening on GNU/Linux OS.

@Chardonneaur Chardonneaur added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Apr 5, 2022
@sgiehl
Copy link
Member

sgiehl commented Apr 5, 2022

Hi @Chardonneaur
Could you please describe that a bit more in detail and maybe provide a list of steps to reproduce?

@Chardonneaur
Copy link
Author

Sure, Microsoft Windows users only, browser (Firefox or Google Chrome):
--> Click on admin.
--> Click on Email report.
--> Create a report with file format PDF.
--> Once created click on Download. It will open up a tab with the pdf, then click on download the pdf within this new window... the result is ... a php file.

@sgiehl
Copy link
Member

sgiehl commented Apr 5, 2022

Hm... that's interesting. We are actually sending a header like
`Content-Disposition: inline; filename="matomo.org_-_Sonntag_6.Mrz_2022-_test.pdf"``
I'm not sure why the browser doesn't use that. Might be an issue with the windows file dialog maybe. Not sure if there is more we could do about it.

@Findus23
Copy link
Member

Findus23 commented Apr 5, 2022

Can you check if renaming the file to .pdf gives the expected PDF file?
If not, then maybe your webserver is not properly set up to execute .php files in all cases.

@Chardonneaur
Copy link
Author

Gonna try that out, thank you guys.

@Chardonneaur
Copy link
Author

@Findus23 the problem is not solved when renaming the .php file into .pdf.

@sgiehl
Copy link
Member

sgiehl commented Apr 6, 2022

I guess we could only change to Content-Disposition: attachment and force the browser to do a download instead trying to display it inline.

@Findus23
Copy link
Member

Findus23 commented Apr 6, 2022

@Chardonneaur In that case can you try opening the .php file in a text editor to see if you actually see PHP code in it. If so, then this is probably not a bug in Matomo, but in the webserver setup.

@sgiehl
Copy link
Member

sgiehl commented Apr 7, 2022

@Findus23 I'm able to reproduce that on my windows machine. Clicking the download link correctly opens the PDF in the browser. But trying to download it suggests index.php as filename and at least for me always fails du to a "network" error. Maybe its a problem that the PDF is generated with a POST request. Might be that the download then tries to fetch the same request with GET and fails due to missing token auth.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 13, 2022
@sgiehl sgiehl added this to the For Prioritization milestone Nov 13, 2022
@Chardonneaur
Copy link
Author

Hi guys,
I have seen again this issue with a client of mine today.

@Chardonneaur
Copy link
Author

This issue happened again yesterday during a training at a different client. It is raising a lot of complains from the end users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants