From 208a3759287a394377468b836aa197f48fb0e0c7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 1 Jun 2006 03:48:06 +0000 Subject: [PATCH] fixed not shown images, if eGW is installed in the document root, with webserver_url empty --- phpgwapi/inc/class.html.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index d0c414b63a..2ffca429cd 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -876,11 +876,17 @@ class html { $url = $name; // name may already contain absolut path } - if(!$GLOBALS['egw_info']['server']['webserver_url']) + if($GLOBALS['egw_info']['server']['webserver_url']) { - $base_path = "./"; + list(,$path) = explode($GLOBALS['egw_info']['server']['webserver_url'],$url); + $path = EGW_SERVER_ROOT.$path; } - if (!@is_readable($base_path . str_replace($GLOBALS['egw_info']['server']['webserver_url'],PHPGW_SERVER_ROOT,$url))) + else + { + $path = EGW_SERVER_ROOT.$url; + } + + if (!@is_readable($path)) { // if the image-name is a percentage, use a progressbar if (substr($name,-1) == '%' && is_numeric($percent = substr($name,0,-1)))