From 44778e383b5c2dbe8fbdbf1838f11e42b527c0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Mechnich?= Date: Mon, 3 Jul 2023 20:13:49 +0200 Subject: [PATCH] Update PHP_CodeSniffer configuration and clean code --- .phpcs.list | 5 ----- SSVNCDaemon.php | 2 +- auth.php | 3 ++- control.php | 10 +++++----- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.phpcs.list b/.phpcs.list index 4abf9ccc..352b9d4b 100644 --- a/.phpcs.list +++ b/.phpcs.list @@ -5,15 +5,10 @@ ./theme/demo/simple/screensaver.php ./theme/ub-mannheim/common/screensaver.php ./theme/ub-mannheim/be/screensaver.php -./theme/ub-mannheim/be/console.php ./theme/ub-mannheim/lc/screensaver.php -./theme/ub-mannheim/lc/console.php ./theme/ub-mannheim/a3/screensaver.php -./theme/ub-mannheim/a3/console.php ./theme/ub-mannheim/a5/screensaver.php -./theme/ub-mannheim/a5/console.php ./theme/ub-mannheim/bwl/screensaver.php -./theme/ub-mannheim/bwl/console.php ./auth.php ./upload.php ./SSVNCDaemon.php diff --git a/SSVNCDaemon.php b/SSVNCDaemon.php index a0b2a792..9a0e6a7e 100644 --- a/SSVNCDaemon.php +++ b/SSVNCDaemon.php @@ -83,7 +83,7 @@ protected function readLog($handle) } if (strstr($buffer, 'create_image') && $client["ip"] != "" && - $client["hostname"]!="" ) { + $client["hostname"]!="") { // add client $this->addClient($client["ip"], $client["hostname"]); diff --git a/auth.php b/auth.php index 5b99ca0a..01cef4d3 100644 --- a/auth.php +++ b/auth.php @@ -1,6 +1,7 @@ exec("UPDATE setting SET value='$layout' WHERE key='layout'"); @@ -442,7 +442,7 @@ function processRequests($db) $file_in_db = $db->querySingle("SELECT id FROM window WHERE file='$delete'"); $delete = str_replace(" ", "\ ", $delete); trace("file in db: $file_in_db"); - if ($file_in_db){ + if ($file_in_db) { if (file_exists($delete)) { trace("+++ DELETE FILE FROM WEBINTERFACE +++"); unlink($delete); @@ -543,14 +543,14 @@ function processRequests($db) // If URL leads to pdf file, download it and treat as upload $headers = get_headers($openURL, 1); - if ($headers["Content-Type"] == "application/pdf"){ + if ($headers["Content-Type"] == "application/pdf") { trace("url seems to lead to a pdf file, so downloading it..."); $temp_name = basename($openURL); $temp_dir = "/tmp"; file_put_contents("$temp_dir/$temp_name", file_get_contents($openURL)); $mimetype = mime_content_type("$temp_dir/$temp_name"); trace("mimetype is $mimetype"); - if ($mimetype == "application/pdf"){ + if ($mimetype == "application/pdf") { $_FILES['file']['name'] = "$temp_name"; $_FILES['file']['tmp_name'] = "$temp_dir/$temp_name"; $_FILES['file']['error'] = "downloaded_from_url"; @@ -569,7 +569,7 @@ function processRequests($db) "section" => "", "state" => "", "file" => $openURL, - "handler" => "palma-browser", + "handler" => "palma-browser", "userid" => "", "date" => $date );