Skip to content

Commit

Permalink
fix autoperm
Browse files Browse the repository at this point in the history
  • Loading branch information
mircobabini committed Aug 30, 2021
1 parent b486743 commit d818b76
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion command.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ public function autoperm( array $args = [], array $assoc_args = [] ) {

$wordpress_path = ABSPATH;

$linux_user = ltrim( $_SERVER['HOME'], '/home/' );
// define linux user
$linux_user = isset( $_SERVER['USER'] ) ? $_SERVER['USER'] : '';
if ( ! $linux_user && isset( $_SERVER['HOME'] ) ) {
$linux_user = str_replace( '/home/', '', $_SERVER['HOME'] );
}

// define linux group
$linux_group = $linux_user;

if ( empty( $wordpress_path ) || empty( $linux_user ) ) {
Expand Down

0 comments on commit d818b76

Please sign in to comment.