no_spaces_inside_parenthesis

This commit is contained in:
Nguyen Tran Chung 2022-12-02 12:45:38 +09:00
parent a709295fd9
commit 956e34b28e
No known key found for this signature in database
GPG key ID: 1E47DA8A9B29876B

View file

@ -145,7 +145,7 @@ if (is_readable($config_file)) {
define('MAX_UPLOAD_SIZE', $max_upload_size_bytes); define('MAX_UPLOAD_SIZE', $max_upload_size_bytes);
// private key and session name to store to the session // private key and session name to store to the session
if ( !defined( 'FM_SESSION_ID')) { if (!defined('FM_SESSION_ID')) {
define('FM_SESSION_ID', 'filemanager'); define('FM_SESSION_ID', 'filemanager');
} }
@ -200,7 +200,7 @@ if (defined('FM_EMBED')) {
} }
session_cache_limiter(''); session_cache_limiter('');
session_name(FM_SESSION_ID ); session_name(FM_SESSION_ID);
function session_error_handling_function($code, $msg, $file, $line) { function session_error_handling_function($code, $msg, $file, $line) {
// Permission denied for default session, try to create a new one // Permission denied for default session, try to create a new one
if ($code == 2) { if ($code == 2) {
@ -241,7 +241,7 @@ defined('FM_SELF_URL') || define('FM_SELF_URL', ($is_https ? 'https' : 'http') .
// logout // logout
if (isset($_GET['logout'])) { if (isset($_GET['logout'])) {
unset($_SESSION[FM_SESSION_ID]['logged']); unset($_SESSION[FM_SESSION_ID]['logged']);
unset( $_SESSION['token']); unset($_SESSION['token']);
fm_redirect(FM_SELF_URL); fm_redirect(FM_SELF_URL);
} }
@ -593,7 +593,7 @@ if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_I
} elseif ($use_curl) { } elseif ($use_curl) {
@$fp = fopen($temp_file, "w"); @$fp = fopen($temp_file, "w");
@$ch = curl_init($url); @$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOPROGRESS, false ); curl_setopt($ch, CURLOPT_NOPROGRESS, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FILE, $fp);
@$success = curl_exec($ch); @$success = curl_exec($ch);
@ -632,7 +632,7 @@ if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_I
// Delete file / folder // Delete file / folder
if (isset($_GET['del'], $_POST['token']) && !FM_READONLY) { if (isset($_GET['del'], $_POST['token']) && !FM_READONLY) {
$del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) ); $del = str_replace('/', '', fm_clean_path($_GET['del']));
if ($del != '' && $del != '..' && $del != '.' && verifyToken($_POST['token'])) { if ($del != '' && $del != '..' && $del != '.' && verifyToken($_POST['token'])) {
$path = FM_ROOT_PATH; $path = FM_ROOT_PATH;
if (FM_PATH != '') { if (FM_PATH != '') {
@ -655,7 +655,7 @@ if (isset($_GET['del'], $_POST['token']) && !FM_READONLY) {
// Create a new file/folder // Create a new file/folder
if (isset($_POST['newfilename'], $_POST['newfile'], $_POST['token']) && !FM_READONLY) { if (isset($_POST['newfilename'], $_POST['newfile'], $_POST['token']) && !FM_READONLY) {
$type = urldecode($_POST['newfile']); $type = urldecode($_POST['newfile']);
$new = str_replace( '/', '', fm_clean_path( strip_tags( $_POST['newfilename'] ) ) ); $new = str_replace('/', '', fm_clean_path(strip_tags($_POST['newfilename'])));
if (fm_isvalid_filename($new) && $new != '' && $new != '..' && $new != '.' && verifyToken($_POST['token'])) { if (fm_isvalid_filename($new) && $new != '' && $new != '..' && $new != '.' && verifyToken($_POST['token'])) {
$path = FM_ROOT_PATH; $path = FM_ROOT_PATH;
if (FM_PATH != '') { if (FM_PATH != '') {
@ -924,7 +924,7 @@ if (!empty($_FILES) && !FM_READONLY) {
} }
$targetPath = $path . $ds; $targetPath = $path . $ds;
if ( is_writable($targetPath) ) { if (is_writable($targetPath)) {
$fullPath = $path . '/' . basename($fullPathInput); $fullPath = $path . '/' . basename($fullPathInput);
$folder = substr($fullPath, 0, strrpos($fullPath, "/")); $folder = substr($fullPath, 0, strrpos($fullPath, "/"));
@ -978,7 +978,7 @@ if (!empty($_FILES) && !FM_READONLY) {
} elseif (move_uploaded_file($tmp_name, $fullPath)) { } elseif (move_uploaded_file($tmp_name, $fullPath)) {
// Be sure that the file has been uploaded // Be sure that the file has been uploaded
if ( file_exists($fullPath) ) { if (file_exists($fullPath)) {
$response = array ( $response = array (
'status' => 'success', 'status' => 'success',
'info' => "file upload successful" 'info' => "file upload successful"
@ -2528,7 +2528,7 @@ function fm_get_size($file)
if ($iswin && class_exists("COM")) { if ($iswin && class_exists("COM")) {
try { try {
$fsobj = new COM('Scripting.FileSystemObject'); $fsobj = new COM('Scripting.FileSystemObject');
$f = $fsobj->GetFile( realpath($file) ); $f = $fsobj->GetFile(realpath($file));
$size = $f->Size; $size = $f->Size;
} catch (Exception $e) { } catch (Exception $e) {
$size = null; $size = null;