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

Plugin no longer works on osTicket 1.18 #63

Open
buff0k opened this issue Nov 2, 2023 · 17 comments
Open

Plugin no longer works on osTicket 1.18 #63

buff0k opened this issue Nov 2, 2023 · 17 comments

Comments

@buff0k
Copy link

buff0k commented Nov 2, 2023

I upgraded my osTicket deployment to 1.18.1 and discovered that the plugin no longer functions. Am looking into the code but I suspect it may ba the javascript not really playing nice with osTicket 1.18.

@buff0k
Copy link
Author

buff0k commented Nov 2, 2023

Can also confirm that the same problem exists with 1.17.5

@buff0k
Copy link
Author

buff0k commented Nov 10, 2023

[10-Nov-2023 06:34:06 UTC] PHP Fatal error: Cannot make non static method Plugin::getInstance() static in class AttachmentPreviewPlugin in /include/plugins/attachment_preview/class.AttachmentPreviewPlugin.php on line 83

@jabrugger
Copy link

Same issue here.

@nandi96
Copy link

nandi96 commented Nov 22, 2023

Hi everyone,

We found a temporary solution for this bug, simply install this plugin in Chrome or Edge:
https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm

After install you must allow the active content (javascript) and File URL permission in the plugin's settings.

@phatair
Copy link

phatair commented Jan 8, 2024

Hello,
is there any solution for this problem? Is this plugin still under development? We have the same problem, that the pdf is not displayed inline.
We are on osticket 1.18.1 and PHP 8.2.

I will test the chrome app but it would be nice if the plugin could be updated.
Are there any plans?

Best regards

@impedator
Copy link

Hello, I'm using this plugin with osTicket 1.18.1 with apache server, after initial challenges now works great, need to add new header in your apache virtualhost config:
Header set Content-Security-Policy "object-src 'self' blob:;"

@nandi96
Copy link

nandi96 commented Mar 5, 2024

Tested, it works!

@buff0k
Copy link
Author

buff0k commented Mar 6, 2024

@impedator does not work for me, pdfs still only showing blank.

@impedator
Copy link

impedator commented Mar 6, 2024

@buff0k did you checked browser console for errors when opening page with ticket? please provide some info about environment.

@buff0k
Copy link
Author

buff0k commented Mar 6, 2024

@impedator the issue I am geetting now is:
Refused to load plugin data from '' because it violates the following Content Security Policy directive: "object-src 'none'".

Note that I am using Nginx with the header included by:
add_header Content-Security-Policy "object-src 'self' blob:;";

I'm going to check other headers that might conflict.

@impedator
Copy link

@buff0k - try: add_header Content-Security-Policy "object-src '*' blob:;"; and check if this is working ok, if yes then investigate proper domain or source, remember that it is not a good idea to use * there ;-)

@buff0k
Copy link
Author

buff0k commented Mar 6, 2024

@impedator
I am now hitting:
Refused to load plugin data from '' because it violates the following Content Security Policy directive: "object-src '*' blob:".
Not sure what is causing this but now Console also reports:
Refused to load plugin data from '' because it violates the following Content Security Policy directive: "object-src 'none'".

So Nginx is applying both policies but neither is passing it through as it runs into the none policy, I need to figure out what is setting that.

@nandi96
Copy link

nandi96 commented Mar 6, 2024

Look this -> osTicket/osTicket#6624

impedator added a commit to impedator/osTicket that referenced this issue Mar 6, 2024
@Cm-8
Copy link

Cm-8 commented Sep 26, 2024

@ramrajone
Copy link

Any news?

I have currently applied changes by @impedator

impedator/osTicket@3e40543#diff-9d3ede82cbb2ca67574bfe9f98bf9ccce84ccb967cadf16cb0ed80ce66d64363R3

This works for v1.17.5
include/staff/header.inc.php

updated to:
header("Content-Security-Policy: frame-ancestors ".$cfg->getAllowIframes()."; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'self' blob:");

old:
header("Content-Security-Policy: frame-ancestors ".$cfg->getAllowIframes()."; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'");

@jayavman
Copy link

Screenshot 2024-11-26 152315
Totally worked for me :> thanks!

@buff0k
Copy link
Author

buff0k commented Nov 27, 2024

I can confirm that this works in v1.18.1 as well.

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

No branches or pull requests

8 participants