diff --git a/cis/testtool/admin/index.php b/cis/testtool/admin/index.php
index 2a00890c4..17586d207 100644
--- a/cis/testtool/admin/index.php
+++ b/cis/testtool/admin/index.php
@@ -28,8 +28,8 @@ require_once('../../../include/functions.inc.php');
require_once('../../../include/frage.class.php');
require_once('../../../include/vorschlag.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
-
-$PHP_SELF=$_SERVER["PHP_SELF"];
+
+$PHP_SELF=$_SERVER["PHP_SELF"];
//wandelt einen String in HEX-Werte um
function strhex($string)
@@ -165,11 +165,15 @@ if(isset($_POST['submitdata']))
if(isset($_POST['submitvorschlag']))
{
$content='';
- if(isset($_FILES['bild']['tmp_name']) && is_uploaded_file($_FILES['bild']['tmp_name']))
+ if(isset($_FILES['bild']['tmp_name']))
{
- //Wenn File ein Bild ist
- if (($_FILES['bild']['type']=="image/gif") || ($_FILES['bild']['type']=="image/jpeg") || ($_FILES['bild']['type']=="image/png"))
- {
+ //Extension herausfiltern
+ $ext = explode('.',$_FILES['bild']['name']);
+ $ext = strtolower($ext[count($ext)-1]);
+
+ //--check that it's a jpeg or gif or png
+ if ($ext=='gif' || $ext=='png' || $ext=='jpg' || $ext=='jpeg')
+ {
$filename = $_FILES['bild']['tmp_name'];
//File oeffnen
$fp = fopen($filename,'r');
@@ -182,6 +186,10 @@ if(isset($_POST['submitvorschlag']))
else
echo "Datei ist kein Bild!
";
}
+ else
+ {
+ echo "kein Bild";
+ }
$vorschlag = new vorschlag($conn);
$error=false;
@@ -340,7 +348,7 @@ if($frage->frage_id!='')
}
//Vorschlag
echo 'Vorschlag'.($vorschlag_id!=''?' Edit':'').'
';
- echo "