From c90c29e92766219ee723e17e980c31d58b916bbf Mon Sep 17 00:00:00 2001 From: nikrou Date: Wed, 21 Jun 2006 19:36:22 +0000 Subject: fix bug 431: src of image are incorrect: ex: ././galleries/img.jpg instead of ./galleries/img.jpg svn merge -r1373:1374 from trunk into branch 1.6 git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1375 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_url.inc.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php index 63316d4d5..9eb424651 100644 --- a/include/functions_url.inc.php +++ b/include/functions_url.inc.php @@ -27,6 +27,7 @@ /** * returns a prefix for each url link on displayed page + * and return an empty string for current path * @return string */ function get_root_url() @@ -34,9 +35,20 @@ function get_root_url() global $page; if ( isset($page['root_path']) ) { - return $page['root_path']; + $root_url = $page['root_path']; + } + else + { + $root_url = PHPWG_ROOT_PATH; + } + if ( dirname($root_url)!='.' ) + { + return $root_url; + } + else + { + return ''; } - return PHPWG_ROOT_PATH; } /** -- cgit v1.2.3