We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a569f43 commit 480c971Copy full SHA for 480c971
1 file changed
app/code/community/Kiatng/Shooter/Helper/Data.php
@@ -71,14 +71,10 @@ public function getRunningUser(): string
71
if (function_exists('posix_getpwuid')) {
72
return posix_getpwuid(posix_geteuid())['name'];
73
}
74
- $username = getenv('USERNAME');
75
- if (!$username) {
76
- $username = getenv('USER');
77
- }
78
79
- $username = trim(shell_exec('whoami'));
80
81
- return $username;
+
+ return getenv('USERNAME')
+ ?? getenv('USER')
+ ?? function_exists('shell_exec') ? trim(shell_exec('whoami')) : get_current_user();
82
83
84
/**
0 commit comments