1
0
Fork 0

Do not use PHP's error control operator

master
Anonymous Contributor 2023-08-23 18:16:35 +02:00
parent 9954f31721
commit e2795e99b9
8 changed files with 26 additions and 14 deletions

View File

@ -224,10 +224,10 @@
$this->FertigesHTML = str_replace("%%datum%%", date("Y-m-dTH:i+2"), $this->FertigesHTML);
//Der Counter wird in den HTML Quellcode eingef<65>gt.
$this->FertigesHTML = str_replace("%%GET_SITE%%", @$_GET['seite'], $this->FertigesHTML);
$this->FertigesHTML = str_replace("%%GET_SITE%%", isset($_GET['seite']) ? $_GET['seite'] : ' ', $this->FertigesHTML);
//Die IP Adresse wird in den HTML Quellcode eingef<65>gt.
$this->FertigesHTML = str_replace("%%GET_IP%%", @$_SERVER["REMOTE_ADDR"], $this->FertigesHTML);
$this->FertigesHTML = str_replace("%%GET_IP%%", isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER['REMOTE_ADDR'] : ' ', $this->FertigesHTML);
// Add CSRF token
$this->FertigesHTML = str_replace("%%CSRF%%", '<input type="hidden" name="csrf" value="'.(isset($_SESSION['csrf']) ? $_SESSION['csrf'] : '').'">', $this->FertigesHTML);

View File

@ -25,9 +25,9 @@ function getDataFromHTTP($URL, $contend = "", $requestTyp = "application/text")
{
if($contend != "")
{
return @file_get_contents($URL, true, stream_context_create(array('http' => array('header' => 'Content-type: '.$requestTyp, 'method' => 'POST', 'timeout' => 0.5, 'content' => $contend))));
return file_get_contents($URL, true, stream_context_create(array('http' => array('header' => 'Content-type: '.$requestTyp, 'method' => 'POST', 'timeout' => 0.5, 'content' => $contend))));
}else{
return @file_get_contents($URL);
return file_get_contents($URL);
}
} catch (Exception $e) {
echo "(HTTP REQUEST) error while conntect to remote server. : ".$URL;

View File

@ -16,10 +16,21 @@ while($row = $statement->fetch())
//$fileNameParts['Time'] = time();
$fileNameParts['UUID'] = $row['id'];
$fileNameParts['FilePath'] = "/data/assets/base/".$fileNameParts[0]."/".$fileNameParts[1]."/".$fileNameParts[2]."/".$fileNameParts[3]."/".$fileNameParts[4];
$fileNameParts['FileSize'] = @filesize($fileNameParts['FilePath']);
if(file_exists($fileNameParts['FilePath'])) {
$filesize = filesize($fileNameParts['FilePath']);
if($filesize === false) {
continue;
}
}
else {
$filesize = 0;
}
$fileNameParts['FileSize'] = $filesize;
$fileNameParts['Count'] = $count++;
if($fileNameParts['FileSize'] == 0 || !file_exists($fileNameParts['FilePath']))
if($fileNameParts['FileSize'] == 0)
{
$add = $RUNTIME['PDO']->prepare('DELETE FROM fsassets WHERE hash = :fileHash');
$add->execute(['fileHash' => $row['hash']]);

View File

@ -15,7 +15,7 @@
while($row = $statement->fetch())
{
$result = @file_get_contents($row['serverURI']."jsonSimStats", false, $ctx);
$result = file_get_contents($row['serverURI']."jsonSimStats", false, $ctx);
if($result == FALSE || $result == "")
{

View File

@ -1,5 +1,5 @@
<?php
if(@$_SESSION['LEVEL'] < 100)
if(!isset($_SESSION['LOGIN']) || !isset($_SESSION['LEVEL']) || $_SESSION['LEVEL'] < 100)
{
$HTML->setHTMLTitle("Kein Zugriff");
$HTML->SetSeitenInhalt("Dazu hast du keine Rechte!");

View File

@ -3,7 +3,7 @@
$HTML->setHTMLTitle("Passwort ändern");
$HTML->importSeitenInhalt("profile.html");
if(isset($_REQUEST['oldPassword']) || @$_REQUEST['oldPassword'] != "")
if(isset($_REQUEST['oldPassword']) || $_REQUEST['oldPassword'] != "")
{
$OLDPassword = trim($_REQUEST['oldPassword']);
@ -17,7 +17,7 @@
if($NewPassword != "")
{
if(isset($_REQUEST['newPasswordRepeate']) || @$_REQUEST['newPasswordRepeate'] != "")
if(isset($_REQUEST['newPasswordRepeate']) || $_REQUEST['newPasswordRepeate'] != "")
{
$NewPasswordRepeate = trim($_REQUEST['newPasswordRepeate']);

View File

@ -135,7 +135,7 @@
$allUsers = "";
while($row = $statementLocalUsers->fetch())
{
$name = '"'.@$row['FirstName']." ".@$row['LastName'].'"';
$name = '"'.$row['FirstName']." ".$row['LastName'].'"';
if($allUsers != "")
{

View File

@ -1,12 +1,13 @@
<?php
$HTML = new HTML();
if(@$_SESSION['LOGIN'] == 'true')
if(isset($_SESSION['LOGIN']))
{
$HTML->importHTML("dashboard.html");
if(@$_SESSION['LEVEL'] > 100)
if(isset($_SESSION['LEVEL']) && $_SESSION['LEVEL'] > 100) {
$HTML->importHTML("dashboard-admin.html");
}
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", htmlspecialchars(@$_SESSION['DISPLAYNAME']));
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", isset($_SESSION['DISPLAYNAME']) ? htmlspecialchars($_SESSION['DISPLAYNAME']) : '');
}
?>