Skip to content

Commit

Permalink
fix: address review
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed May 22, 2024
1 parent a0d9dca commit 137986f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion console.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ function exceptionHandler($exception) {
}

$user = posix_getuid();
$userName = posix_getpwuid($user) !== false ? posix_getpwuid($user)['name'] : '';
$userNameArray = posix_getpwuid($user);
if ($userNameArray !== false) {
$userName = $userNameArray['name'];
}
$configUser = fileowner(OC::$configDir . 'config.php');
$configuredUser = $config->getSystemValueString('php.user', '');
if ($user !== $configUser && $userName !== $configuredUser) {
Expand Down
5 changes: 4 additions & 1 deletion cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@
}

$user = posix_getuid();
$userName = posix_getpwuid($user) !== false ? posix_getpwuid($user)['name'] : '';
$userNameArray = posix_getpwuid($user);
if ($userNameArray !== false)) {

Check failure

Code scanning / Psalm

ParseError Error

Syntax error, unexpected ')' on line 134

Check failure on line 134 in cron.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

ParseError

cron.php:134:32: ParseError: Syntax error, unexpected ')' on line 134 (see https://psalm.dev/173)
$userName = $userNameArray['name'];
}
$configUser = fileowner(OC::$configDir . 'config.php');
$configuredUser = $config->getSystemValueString('php.user', '');
if ($user !== $configUser && $userName !== $configuredUser) {
Expand Down

0 comments on commit 137986f

Please sign in to comment.