| version 1.5, 2002/10/16 21:19:22 |
version 1.6, 2003/02/04 21:46:04 |
|
|
| * Tony J. White, tjw@tjw.org, 2002-04-15 |
* Tony J. White, tjw@tjw.org, 2002-04-15 |
| **************************************************************************/ |
**************************************************************************/ |
| |
|
| /* $Platon: $ */ |
/* $Platon: phpWebFileManager/plugins/file.php,v 1.5 2002/10/16 21:19:22 nepto Exp $ */ |
| |
|
| /* |
|
| * Moving from plugins/ subdirectory to phpWebFileManager root directory |
|
| */ |
|
| |
|
| $fm_file_plugin_orig_dir = getcwd(); |
|
| chdir('../'); |
|
| |
|
| /* |
/* |
| * phpWebFileManager initialization |
* phpWebFileManager initialization |
| Line 50 $fm_init_file = dirname(__FILE__) |
|
| Line 43 $fm_init_file = dirname(__FILE__) |
|
| } |
} |
| |
|
| require_once $fm_init_file; |
require_once $fm_init_file; |
| require_once $PN_PathPrefix . 'lib/fnc.append_slash.php'; |
require_once $PN_PathPrefix . 'functions.inc.php'; |
| |
|
| |
/* |
| |
* Moving from plugins/ subdirectory to phpWebFileManager root directory |
| |
*/ |
| |
|
| |
$fm_file_plugin_orig_dir = getcwd(); |
| |
chdir('../'); |
| |
|
| /* |
/* |
| * Main job |
* Main job |
| Line 112 function fm_main() |
|
| Line 112 function fm_main() |
|
| */ |
*/ |
| |
|
| if (! isset($HTTP_GET_VARS[$fm_cfg['cgi'].'path'])) { |
if (! isset($HTTP_GET_VARS[$fm_cfg['cgi'].'path'])) { |
| echo 'CGI variable '.$fm_cfg['cgi'].'path is not present.'; |
echo 'CGI variable "'.$fm_cfg['cgi'].'path" is not present.'; |
| return false; |
return false; |
| } |
} |
| |
|
| $file = append_slash($fm_cfg['dir']['root']) . substr($HTTP_GET_VARS[$fm_cfg['cgi'].'path'], 1); |
$file = $HTTP_GET_VARS[$fm_cfg['cgi'].'path']; |
| |
if ($file{0} != '/') { |
| |
echo 'Incorrect "'.$fm_cfg['cgi'].'path" CGI variable.'; |
| |
return false; |
| |
} |
| |
|
| |
$file = substr($file, 1); |
| |
$file = preg_replace('|\.\./|', '', $file); |
| |
$file = preg_replace('|\.\.$|', '', $file); |
| |
$file = fm_append_slash($fm_cfg['dir']['root']).$file; |
| |
|
| /* |
/* |
| * Testing file |
* Testing file |