Also on our WordPress .htaccess I’ve commented out the CSP rules, but wouldn’t expect it to be these anyway.
# X-XSS-Protection
#Header set X-XSS-Protection "1; mode=block"
# X-Frame-Options
# Header add Content-Security-Policy "default-src 'self'; script-src: 'self' 'unsafe-inline';"
# X-Content-Type nosniff
#Header set X-Content-Type-Options nosniff
I’ve hacked a workaround by loading the pdf directly into an iframe.
In docViewer function in FileSystem.php
replaced this line:-
$doc_preview_html = '<iframe src="https://docs.google.com/viewer?url=' . urlencode($url) . '&embedded=true" width="100%" height="600" style="border: none;"></iframe>';
with
$doc_preview_html = '<iframe class="documentsIframe" src="'.$url.'" title="Preview Document" style="width: 100%;height: 1000px;"></iframe>';
Can anyone suggest an easier way to make a shortcode and have access to the file URL outside of the plugin – or at least make the google doc viewer work?
-
This reply was modified 2 years, 5 months ago by
Lee Evans.