diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-28 15:38:39 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-28 15:38:39 -0800 |
commit | e3e72ca4da0375d88b86ba69b6596b10be164e23 (patch) | |
tree | f32855f9416252b474ab8d598a345fdcf1455b7d /modules/gallery/helpers | |
parent | f28b80fcf43e02ca65f419eb6774321dc30a2a37 (diff) | |
parent | fd94f4bec21a7deaa86d468da704a048d2be751e (diff) |
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/access.php | 18 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_block.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 2 |
3 files changed, 19 insertions, 3 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 7e8b079a..af336798 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -637,8 +637,22 @@ class access_Core { $dirs[] = dirname($album->thumb_path()); } - $base_url = url::site("?kohana_uri=/file_proxy"); - $base_url = str_replace("/?", "?", $base_url); + $base_url = url::base(true); + $sep = "?"; + if (strpos($base_url, "?") !== false) { + $sep = "&"; + } + $base_url .= $sep . "kohana_uri=/file_proxy"; + // Replace "/index.php/?kohana..." with "/index.php?koahan..." + // Doesn't apply to "/?kohana..." or "/foo/?kohana..." + // Can't check for "index.php" since the file might be renamed, and + // there might be more Apache aliases / rewrites at work. + $url_path = parse_url($base_url, PHP_URL_PATH); + // Does the URL path have a file component? + if (preg_match("#[^/]+\.php#i", $url_path)) { + $base_url = str_replace("/?", "?", $base_url); + } + foreach ($dirs as $dir) { if ($value === self::DENY) { $fp = fopen("$dir/.htaccess", "w+"); diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 46742743..eabdcebc 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -93,7 +93,7 @@ class gallery_block_Core { case "language": $locales = locales::installed(); - if (count($locales)) { + if (count($locales) > 1) { foreach ($locales as $locale => $display_name) { $locales[$locale] = SafeString::of_safe_html($display_name); } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d6944323..7f2d4ec7 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -71,6 +71,7 @@ class gallery_theme_Core { static function page_bottom($theme) { $session = Session::instance(); if ($session->get("profiler", false)) { + Profiler::enable(); $profiler = new Profiler(); $profiler->render(); } @@ -87,6 +88,7 @@ class gallery_theme_Core { static function admin_page_bottom($theme) { $session = Session::instance(); if ($session->get("profiler", false)) { + Profiler::enable(); $profiler = new Profiler(); $profiler->render(); } |