[Tickets #3040] NEW: images in MS Word document

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Nov 24 13:27:29 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=3040
-----------------------------------------------------------------------
 Ticket             | 3040
 Created By         | dgehl at inverse.ca
 Summary            | images in MS Word document
 Queue              | Horde Framework Packages
 Version            | FRAMEWORK_3
 State              | Unconfirmed
 Priority           | 2. Medium
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


dgehl at inverse.ca (2005-11-24 13:27) wrote:

This bug is present in horde-3.0.5

When viewing attached MS Word documents, images inside the documents are
extracted by wvhtml and created in the temporary directory (/tmp in my
case). Unfortunately, the html returned to the user does not contain any
directory instruction so that all images are shown as broken links.

A solution is to add a regular expression to
lib/Horde/MIME/Viewer/msword.php which rewrites to <img src > part.
Replacing 
return $data
by
return preg_replace('/<img width="(\d+)" height="(\d+)" alt="([^"]+)"
src="([^"]+)"/i', '<img width="${1}" height="${2}" alt="${3}"
src="/wvTmpImages/${4}"', $data);
instructs the browser to fetch to images from wvTmpImages

This directory can then be created as an alias in Apache 

Alias /wvTmpImages/ "/tmp/"

<Directory /tmp>
<Files *.png>
Order allow,deny
Allow from all
</Files>
Order allow,deny
Deny from all
</Directory>





More information about the bugs mailing list