From: Michael M Slusarz Date: Thu, 19 Feb 2009 06:34:07 +0000 (-0700) Subject: Use abiword for msword display X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=83fe90ba39c1bfcb7946947200221e33689f011e;p=horde.git Use abiword for msword display --- diff --git a/framework/Mime/lib/Horde/Mime/Viewer/msword.php b/framework/Mime/lib/Horde/Mime/Viewer/msword.php index ce205e509..945ee9b62 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/msword.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/msword.php @@ -1,7 +1,7 @@ _conf['location']) . "\\wvHtml.xml -d $tmp_dir -1 $tmp_word > $tmp_output"; - } else { - $version = exec($this->_conf['location'] . ' --version'); - $args = (version_compare($version, '0.7.0') >= 0) - ? " --charset=$charset --targetdir=$tmp_dir $tmp_word $tmp_file" - : " $tmp_word $tmp_output"; - } - - $fh = fopen($tmp_word, 'w'); - fwrite($fh, $this->_mimepart->getContents()); - fclose($fh); + file_put_contents($tmp_word, $this->_mimepart->getContents()); + $args = ' --to=html --to-name=' . $tmp_output . ' ' . $tmp_word; exec($this->_conf['location'] . $args); if (file_exists($tmp_output)) { - return array( - $this->_mimepart->getMimeId() => array( - 'data' => file_get_contents($tmp_output), - 'status' => array(), - 'type' => 'text/html; charset=' . $charset - ) - ); + $data = file_get_contents($tmp_output); + $type = 'text/html'; + } else { + $data = _("Unable to translate this Word document"); + $type = 'text/plain'; } return array( $this->_mimepart->getMimeId() => array( - 'data' => _("Unable to translate this Word document"), + 'data' => $data, 'status' => array(), - 'type' => 'text/plain; charset=' . $charset + 'type' => $type . '; charset=' . NLS::getCharset() ) ); }