summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/access.php18
-rw-r--r--modules/gallery/helpers/gallery_block.php2
-rw-r--r--modules/gallery/helpers/gallery_theme.php2
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();
}