Posts: 3
Threads: 0
Joined: Sep 2010
2010-09-17, 06:24:48
(This post was last modified: 2010-09-17, 21:49:58 by maeve23.)
Following line in "admin/upload-ajax.php" (GS2.01) calculates wrong path when used with Apache alias:
Code:
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
EDIT:
Dirty/quick fix is to just replace it with following:
Code:
$targetPath = get_root_path() . 'data/uploads/';
Posts: 1,848
Threads: 86
Joined: Aug 2009
Is there any reason why this shouldnt be the default way to handle this? I dont see any reason...
john5 Wrote:Following line in "admin/upload-ajax.php" (GS2.01) calculates wrong path when used with Apache alias:
Code:
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
EDIT:
Dirty/quick fix is to just replace it with following:
Code:
$targetPath = get_root_path() . 'data/uploads/';
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 3
Threads: 0
Joined: Sep 2010
2010-09-18, 07:02:45
(This post was last modified: 2010-09-18, 07:14:46 by maeve23.)
The reason is that $_SERVER['DOCUMENT_ROOT'] does not give the path to executing (.php) files location when used with Apache alias (at least on my local WAMP and on my Linux host).
dirname(__FILE__) (as in get_root_path()) should be used instead.
EDIT: More about unexpected DOCUMENT_ROOT values:
https://issues.apache.org/bugzilla/show_...i?id=26052
Wishes,
Posts: 1,848
Threads: 86
Joined: Aug 2009
I just looked, and that line now reads:
Code:
$targetPath = GSDATAUPLOADPATH;
and in common.php, GSDATAUPLOADPATH is set to this:
Code:
define('GSDATAUPLOADPATH', get_root_path(). 'data/uploads/');
So i think we are fine with 2.02 (very stable at this point - we are just working out all the remaining small bugs before we release it)
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!