aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2006-06-21 19:34:46 +0000
committernikrou <nikrou@piwigo.org>2006-06-21 19:34:46 +0000
commit84536f02755a328ab689106719ba17c79f09f85d (patch)
tree7924629a0519949c79865a08e2af1ec7711f2bb5
parent9aa29cc28e27df14cd64ef485f2c2fe3b09fed47 (diff)
fix bug 431: src of image are incorrect:
ex: ././galleries/img.jpg instead of ./galleries/img.jpg git-svn-id: http://piwigo.org/svn/trunk@1374 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_url.inc.php16
1 files 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;
}
/**