diff options
author | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-05-05 22:07:24 +0400 |
---|---|---|
committer | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-05-05 22:07:24 +0400 |
commit | 6e8cd75fefd135f3f43996f4483942a9f68d1579 (patch) | |
tree | ce93efffc2ee7ebe9de573b4790d2abf2a77acac | |
parent | 1d8bbb32d5679d2603be5bfbc3f355da618aab93 (diff) |
Re-fix #590
-rw-r--r-- | core/Url.php | 15 | ||||
-rw-r--r-- | core/ViewDataTable/GenerateGraphHTML.php | 6 |
2 files changed, 16 insertions, 5 deletions
diff --git a/core/Url.php b/core/Url.php index c1fca7f647..87efb9efe5 100644 --- a/core/Url.php +++ b/core/Url.php @@ -47,6 +47,17 @@ class Piwik_Url static public function getCurrentUrlWithoutFileName() { $host = self::getCurrentHost(); + $urlDir = self::getCurrentScriptPath(); + return $host.$urlDir; + } + + /** + * If current URL is "http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2" + * will return "/dir1/dir2/" + * @return string with trailing slash + */ + static public function getCurrentScriptPath() + { $queryString = self::getCurrentScriptName() ; //add a fake letter case /test/test2/ returns /test which is not expected @@ -57,7 +68,7 @@ class Piwik_Url { $urlDir .= '/'; } - return $host.$urlDir; + return $urlDir; } /** @@ -90,7 +101,7 @@ class Piwik_Url } return $url; } - + /** * If current URL is "http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2" * will return "http://example.org" diff --git a/core/ViewDataTable/GenerateGraphHTML.php b/core/ViewDataTable/GenerateGraphHTML.php index af92c9f06b..b12b4c33ea 100644 --- a/core/ViewDataTable/GenerateGraphHTML.php +++ b/core/ViewDataTable/GenerateGraphHTML.php @@ -112,9 +112,9 @@ abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable $width = $this->width; $height = $this->height; - $currentPath = dirname(Piwik_Url::getCurrentScriptName() . 'x'); - $pathToLibraryOpenChart = $currentPath . '/libs/open-flash-chart/'; - $pathToLibrarySwfObject = $currentPath . '/libs/swfobject/'; + $currentPath = Piwik_Url::getCurrentScriptPath(); + $pathToLibraryOpenChart = $currentPath . 'libs/open-flash-chart/'; + $pathToLibrarySwfObject = $currentPath . 'libs/swfobject/'; $url = Piwik_Url::getCurrentUrlWithoutQueryString() . $url; // escape the & and stuff: |