@@ -218,13 +218,13 @@ |
||
| 218 | 218 | function get_file($user) { |
| 219 | 219 | $dir = sandbox_dir($user); |
| 220 | 220 | $url = post_str('url'); |
| 221 | - if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) { |
|
| 221 | + if (filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
| 222 | 222 | error_page('Not a valid URL'); |
| 223 | 223 | } |
| 224 | 224 | $fname = basename($url); |
| 225 | 225 | $path = "$dir/$fname"; |
| 226 | 226 | if (file_exists($path)) { |
| 227 | - error_page("File $fname exists; delete it first."); |
|
| 227 | + error_page("file $fname exists; delete it first."); |
|
| 228 | 228 | } |
| 229 | 229 | copy($url, $path); |
| 230 | 230 | $notice = "Fetched file from <strong>$url</strong><br/>"; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } else { |
| 92 | 92 | sort($files); |
| 93 | 93 | start_table(); |
| 94 | - table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download"); |
|
| 94 | + table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); |
|
| 95 | 95 | foreach ($files as $f) { |
| 96 | 96 | $path = "$dir/$f"; |
| 97 | 97 | list($error, $size, $md5) = sandbox_parse_link_file($path); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $s = stat($tmp_name); |
| 142 | 142 | $size = $s['size']; |
| 143 | 143 | list($exist, $elf) = sandbox_lf_exist($user, $md5); |
| 144 | - if ($exist){ |
|
| 144 | + if ($exist) { |
|
| 145 | 145 | $notice .= "<strong>Notice:</strong> Invalid Upload<br/>"; |
| 146 | 146 | $notice .= "You are trying to upload file <strong>$name</strong><br/>"; |
| 147 | 147 | $notice .= "Another file <strong>$elf</strong> with the same content (md5: $md5) already exists!<br/>"; |
@@ -216,15 +216,15 @@ discard block |
||
| 216 | 216 | error_page("no such physical file"); |
| 217 | 217 | } |
| 218 | 218 | $bused = sandbox_file_in_use($user, $name); |
| 219 | - if ($bused){ |
|
| 219 | + if ($bused) { |
|
| 220 | 220 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
| 221 | - } else{ |
|
| 221 | + } else { |
|
| 222 | 222 | $notice = "<strong>$name</strong> is not being used by any batch(es) and successfully deleted from your sandbox<br/>"; |
| 223 | 223 | unlink("$dir/$name"); |
| 224 | 224 | unlink($p); |
| 225 | 225 | |
| 226 | 226 | } |
| 227 | - list_files($user,$notice); |
|
| 227 | + list_files($user, $notice); |
|
| 228 | 228 | //Header("Location: sandbox.php"); |
| 229 | 229 | } |
| 230 | 230 | function download_file($user) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if (!$action) $action = post_str('action', true); |
| 266 | 266 | |
| 267 | 267 | switch ($action) { |
| 268 | -case '': list_files($user,""); break; |
|
| 268 | +case '': list_files($user, ""); break; |
|
| 269 | 269 | case 'upload_file': upload_file($user); break; |
| 270 | 270 | case 'delete_file': delete_file($user); break; |
| 271 | 271 | case 'download_file': download_file($user); break; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $s = stat($tmp_name); |
| 142 | 142 | $size = $s['size']; |
| 143 | 143 | list($exist, $elf) = sandbox_lf_exist($user, $md5); |
| 144 | - if ($exist){ |
|
| 144 | + if ($exist) { |
|
| 145 | 145 | $notice .= "<strong>Notice:</strong> Invalid Upload<br/>"; |
| 146 | 146 | $notice .= "You are trying to upload file <strong>$name</strong><br/>"; |
| 147 | 147 | $notice .= "Another file <strong>$elf</strong> with the same content (md5: $md5) already exists!<br/>"; |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | error_page("no such physical file"); |
| 217 | 217 | } |
| 218 | 218 | $bused = sandbox_file_in_use($user, $name); |
| 219 | - if ($bused){ |
|
| 219 | + if ($bused) { |
|
| 220 | 220 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
| 221 | - } else{ |
|
| 221 | + } else { |
|
| 222 | 222 | $notice = "<strong>$name</strong> is not being used by any batch(es) and successfully deleted from your sandbox<br/>"; |
| 223 | 223 | unlink("$dir/$name"); |
| 224 | 224 | unlink($p); |