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.
*/
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);
}
/**