6.0.0-beta1
9/24/25

[#3040] images in MS Word document
Summary images in MS Word document
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester dgehl (at) inverse (dot) ca
Created 11/24/2005 (7244 days ago)
Due
Updated 11/24/2005 (7244 days ago)
Assigned
Resolved 11/24/2005 (7244 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/24/2005 10:34:11 PM Chuck Hagenbuch Comment #2
State ⇒ Not A Bug
Reply to this comment
11/24/2005 09:27:26 PM dgehl (at) inverse (dot) ca Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ images in MS Word document
Queue ⇒ Horde Framework Packages
Reply to this comment
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>


Saved Queries