summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gallery.module7
1 files changed, 5 insertions, 2 deletions
diff --git a/gallery.module b/gallery.module
index d9639c3..ede709f 100644
--- a/gallery.module
+++ b/gallery.module
@@ -236,12 +236,15 @@ function _gallery_init($full = false) {
$relativeG2Path = $galleryDir;
$embedUri = url('gallery', NULL, NULL, TRUE);
if (variable_get('clean_url', 0)) {
- if (arg(0) != 'gallery' && trim('http://'.$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '/') != $base_url) {
- for ($i = 0; $i < count(explode('/', $_GET['q'])); $i++ ) {
+ $path = str_replace($base_url . '/', '','http://'.$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ print "<!--"; print_r($path) ; print "-->";
+ if (arg(0) != 'gallery' && $path) {
+ for ($i = 0; $i < count(explode('/', $path)); $i++ ) {
$relativeG2Path = '../' . $relativeG2Path;
}
}
}
+ $embedUri = url('gallery', NULL, NULL, TRUE);
$params = array('embedUri' => $embedUri,
'relativeG2Path' => $relativeG2Path,
'loginRedirect' => url('user/login', NULL, NULL, TRUE),