From: Chuck Hagenbuch Date: Thu, 15 Jan 2009 21:08:17 +0000 (-0500) Subject: this code was making incorrect assumptions about my directory layout. This X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=394a4756d85d1a1448a1475c297fc69c20824d0d;p=horde.git this code was making incorrect assumptions about my directory layout. This should be a little better, but ideally we'd pass the same parameters to base64ImgData() that we pass to Horde::img (app, image) so that it can figure out the path reliably. --- diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 74a4a3ef7..d36ff0af0 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1735,8 +1735,8 @@ class IMP */ public function base64ImgData($file) { - return 'data:image/' . substr($file, strrpos($file, '.') + 1) . ';base64,' . - base64_encode(file_get_contents(dirname(realpath($GLOBALS['registry']->get('fileroot', 'horde'))) . $file)); + $data = file_get_contents(realpath($GLOBALS['registry']->get('fileroot', 'horde')) . preg_replace('/^' . preg_quote($GLOBALS['registry']->get('webroot', 'horde'), '/') . '/', '', $file)); + return 'data:image/' . substr($file, strrpos($file, '.') + 1) . ';base64,' . base64_encode($data); } /**