[geeklog-hg] geeklog: Fixed a bug where Filemanager didn't work properly when...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Fri Jan 17 08:24:47 EST 2014
changeset 9430:d2f23bdd0891
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/d2f23bdd0891
user: Kenji ITO <mystralkk at gmail.com>
date: Fri Jan 17 22:23:33 2014 +0900
description:
Fixed a bug where Filemanager didn't work properly when images directory is not under document root
diffstat:
public_html/filemanager/index.php | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 828a9e3b1b78 -r d2f23bdd0891 public_html/filemanager/index.php
--- a/public_html/filemanager/index.php Wed Jan 15 10:45:12 2014 +0900
+++ b/public_html/filemanager/index.php Fri Jan 17 22:23:33 2014 +0900
@@ -158,10 +158,13 @@
);
// Values to be overridden by Geeklog (system)
-$_CONF['path_html'] = str_replace('\\', '/', $_CONF['path_html']);
$fileRoot = $_CONF['path_html'] . 'images/library/';
+$fileRoot = str_replace('\\', '/', $fileRoot);
$docRoot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
-$relPath = str_replace($docRoot, '', $fileRoot);
+
+$serverRoot = (stripos($fileRoot, $docRoot) === 0);
+preg_match('@\Ahttps?://[^/]+(/.*/)filemanager/index\.php at i', COM_getCurrentURL(), $match);
+$relPath = $match[1] . 'images/library/';
$_FM_CONF['options']['culture'] = COM_getLangIso639Code();
$_FM_CONF['options']['defaultViewMode'] = $_CONF['filemanager_default_view_mode'];
@@ -173,6 +176,7 @@
$_FM_CONF['options']['fileSorting'] = $_CONF['filemanager_file_sorting'];
$_FM_CONF['options']['chars_only_latin'] = $_CONF['filemanager_chars_only_latin'];
$_FM_CONF['options']['dateFormat'] = $_CONF['filemanager_date_format'];
+$_FM_CONF['options']['serverRoot'] = $serverRoot;
$_FM_CONF['options']['fileRoot'] = $fileRoot;
$_FM_CONF['options']['relPath'] = $relPath;
$_FM_CONF['options']['logger'] = $_CONF['filemanager_logger'];
More information about the geeklog-cvs
mailing list