From 228a1e85e3c53b7048bc69d84f3ce00e06582862 Mon Sep 17 00:00:00 2001 From: Safin85 Date: Mon, 11 Jan 2016 17:02:09 +0100 Subject: [PATCH 1/2] Update files.php if You use hard code size, some files is going to be destroyed. Because the will not fully load and in case of storing, it will be stored not the full file. --- includes/classes/files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/files.php b/includes/classes/files.php index 4cfe6e2..87d9725 100644 --- a/includes/classes/files.php +++ b/includes/classes/files.php @@ -78,7 +78,7 @@ public function file_list($srvid,$dir,$tpl_browse=false) // Read file $fh = fopen($game_dir, "rb"); - $file_content = fread($fh, 4096); + $file_content = fread($fh, filesize($game_dir)); fclose($fh); // Return remote file content From 30ad9873c84d90e281724c9d5c249cb893af8ed0 Mon Sep 17 00:00:00 2001 From: Safin85 Date: Tue, 12 Jan 2016 17:23:47 +0100 Subject: [PATCH 2/2] Update network.php try to use "shell_exec" before "exec", because "shell_exec" give You formatted data back with breaklines. Exec gives only a string w./o any formatting. This make little easier to read console output. --- includes/classes/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/classes/network.php b/includes/classes/network.php index 1cdbe0e..cde9483 100644 --- a/includes/classes/network.php +++ b/includes/classes/network.php @@ -155,8 +155,8 @@ public function runcmd($srvid,$netarr,$cmd,$output=false,$gamesrv_id=false) if($settings['debug']) echo "Running Command: $cmd
"; // Try exec - if(function_exists('exec')) return trim(exec($cmd)); - elseif(function_exists('shell_exec')) return trim(shell_exec($cmd)); + if(function_exists('shell_exec')) return trim(shell_exec($cmd)); + elseif(function_exists('exec')) return trim(exec($cmd)); elseif(function_exists('system')) return trim(system($cmd)); else return 'RunCMD: The "exec" function is not available! You must enable exec() in your php.ini file or choose the "Remote Server" option.'; }