Use asset_url() for loading viewer files (#4307)
This commit is contained in:
parent
59b64ae7cd
commit
8d420a94cc
1 changed files with 3 additions and 2 deletions
|
@ -74,6 +74,7 @@ class odfviewer extends rcube_plugin
|
||||||
{
|
{
|
||||||
if (!$args['download'] && $args['mimetype'] && in_array($args['mimetype'], $this->odf_mimetypes)) {
|
if (!$args['download'] && $args['mimetype'] && in_array($args['mimetype'], $this->odf_mimetypes)) {
|
||||||
if (empty($_GET['_load'])) {
|
if (empty($_GET['_load'])) {
|
||||||
|
$rcmail = rcube::get_instance();
|
||||||
$exts = rcube_mime::get_mime_extensions($args['mimetype']);
|
$exts = rcube_mime::get_mime_extensions($args['mimetype']);
|
||||||
$suffix = $exts ? '.'.$exts[0] : '.odt';
|
$suffix = $exts ? '.'.$exts[0] : '.odt';
|
||||||
$fn = md5(session_id() . $_SERVER['REQUEST_URI']) . $suffix;
|
$fn = md5(session_id() . $_SERVER['REQUEST_URI']) . $suffix;
|
||||||
|
@ -99,8 +100,8 @@ class odfviewer extends rcube_plugin
|
||||||
$html = file_get_contents($this->home . '/odf.html');
|
$html = file_get_contents($this->home . '/odf.html');
|
||||||
header("Content-Type: text/html; charset=" . RCMAIL_CHARSET);
|
header("Content-Type: text/html; charset=" . RCMAIL_CHARSET);
|
||||||
echo strtr($html, array(
|
echo strtr($html, array(
|
||||||
'%%DOCROOT%%' => $this->urlbase,
|
'%%DOCROOT%%' => $rcmail->output->asset_url($this->urlbase),
|
||||||
'%%DOCURL%%' => $this->tempbase . $fn, # $_SERVER['REQUEST_URI'].'&_load=1',
|
'%%DOCURL%%' => $rcmail->output->asset_url($this->tempbase . $fn), # $_SERVER['REQUEST_URI'].'&_load=1',
|
||||||
));
|
));
|
||||||
$args['abort'] = true;
|
$args['abort'] = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue