Added some missing issets

This commit is contained in:
Tim Windelschmidt 2016-07-18 19:50:43 +02:00
parent 73f514522b
commit 10bad65fa1
2 changed files with 69 additions and 65 deletions

View File

@ -4,6 +4,7 @@
require("include/cleanup.inc.php"); require("include/cleanup.inc.php");
include("geshi.php"); include("geshi.php");
if(isset($_POST['action'])) {
if($_POST['action'] == "upload") { if($_POST['action'] == "upload") {
if($_POST['textar'] != "") { if($_POST['textar'] != "") {
@ -40,6 +41,7 @@
header("Location: {$_SERVER['PHP_SELF']}?code=2"); header("Location: {$_SERVER['PHP_SELF']}?code=2");
} }
} }
}
else if(isset($_GET['fileid'])) { else if(isset($_GET['fileid'])) {
include("include/header.php"); include("include/header.php");

View File

@ -3,6 +3,7 @@
require("include/config.inc.php"); require("include/config.inc.php");
require("include/cleanup.inc.php"); require("include/cleanup.inc.php");
if(isset($_POST['action'])) {
if ($_POST['action'] == "upload") { if ($_POST['action'] == "upload") {
if ($_FILES['upfile']['size'] > 0) { if ($_FILES['upfile']['size'] > 0) {
@ -50,16 +51,15 @@
chmod($uploaddir . $file_localname, 0777); chmod($uploaddir . $file_localname, 0777);
header("Location: {$_SERVER['PHP_SELF']}?fileid=" . $file_id); header("Location: {$_SERVER['PHP_SELF']}?fileid=" . $file_id);
} } else {
else {
header("Location: {$_SERVER['PHP_SELF']}?code=1"); header("Location: {$_SERVER['PHP_SELF']}?code=1");
} }
} } else {
else {
print_r($_FILES); print_r($_FILES);
header("Location: {$_SERVER['PHP_SELF']}?code=2"); header("Location: {$_SERVER['PHP_SELF']}?code=2");
} }
} }
}
else if(isset($_GET['fileid'])) { else if(isset($_GET['fileid'])) {
header("X-Trash-File: " . $base_url ."b/{$_GET['fileid']}"); header("X-Trash-File: " . $base_url ."b/{$_GET['fileid']}");
include("include/header.php"); include("include/header.php");
@ -114,6 +114,7 @@
} }
else { else {
include("include/header.php"); include("include/header.php");
if (isset($_GET['code'])) {
switch($_GET['code']) { switch($_GET['code']) {
case "1": case "1":
echo "<p>Datei konnte nicht Kopiert werden!</p>"; echo "<p>Datei konnte nicht Kopiert werden!</p>";
@ -122,11 +123,12 @@
echo "<p>Keine Datei angegeben oder Datei zu gross!</p>"; echo "<p>Keine Datei angegeben oder Datei zu gross!</p>";
break; break;
} }
}
?> ?>
<form name="ul" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" <form name="ul" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"
onsubmit="document.ul.u.value='Bitte warten ...';document.ul.u.disabled=true" > onsubmit="document.ul.u.value='Bitte warten ...';document.ul.u.disabled=true" >
<input type="hidden" name="action" value="upload" /> <input type="hidden" name="action" value="upload" />
Dateien bis max. <?php echo ini_get(post_max_size); ?>:<br/> Dateien bis max. <?php echo ini_get('post_max_size'); ?>:<br/>
<input type="file" name="upfile" /><br /><br /> <input type="file" name="upfile" /><br /><br />
G&uuml;ltigkeit: G&uuml;ltigkeit:
<select name="validity" size="1"> <select name="validity" size="1">